]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Include net_in_bytes, net_out_bytes in event
authorAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 24 Jan 2023 10:42:39 +0000 (12:42 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 16 Mar 2023 05:38:57 +0000 (07:38 +0200)
These fields are mainly intended for the mail_user_session_finished event.

src/imap/imap-client.c

index dff67c267ac4adf7f28b7ba1707db4be59fa02f0..8ffbf1d9c46d76649d644a08acfcb31e79c6b4b7 100644 (file)
@@ -339,6 +339,10 @@ const char *client_stats(struct client *client)
                        "Failed to expand imap_logout_format=%s: %s",
                        client->set->imap_logout_format, error);
        }
+
+       event_add_int(client->event, "net_in_bytes", i_stream_get_absolute_offset(client->input));
+       event_add_int(client->event, "net_out_bytes", client->output->offset);
+
        return str_c(str);
 }