]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Add local/remote_ip/port to imap client event fields
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 21 Nov 2019 13:12:12 +0000 (15:12 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 26 Nov 2019 09:56:35 +0000 (11:56 +0200)
src/imap/main.c

index 6f6b7d9e9704fe66b0c5ac8542cd199afa2cb656..7f6e98ab4419d71fd9307b559c74fb04c48a672c 100644 (file)
@@ -253,6 +253,14 @@ int client_create_from_input(const struct mail_storage_service_input *input,
                { .key = "session", .value = input->session_id },
                { .key = NULL }
        });
+       if (input->local_ip.family != 0)
+               event_add_str(event, "local_ip", net_ip2addr(&input->local_ip));
+       if (input->local_port != 0)
+               event_add_int(event, "local_port", input->local_port);
+       if (input->remote_ip.family != 0)
+               event_add_str(event, "remote_ip", net_ip2addr(&input->remote_ip));
+       if (input->remote_port != 0)
+               event_add_int(event, "remote_port", input->remote_port);
 
        service_input = *input;
        service_input.parent_event = event;