]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Fixed hibernation to work with non-TCP connections.
authorTimo Sirainen <tss@iki.fi>
Tue, 25 Aug 2015 15:27:44 +0000 (18:27 +0300)
committerTimo Sirainen <tss@iki.fi>
Tue, 25 Aug 2015 15:27:44 +0000 (18:27 +0300)
Mainly meaning UNIX socket connections from login processes, which are
proxying TLS connections.

src/imap/imap-client-hibernate.c

index 1416725530d6ce725ce8d80f49ae09d667c5bc9c..ea4557d6c2d537caef21c0a80e0b0a6df6b22094 100644 (file)
@@ -49,7 +49,8 @@ static void imap_hibernate_write_cmd(struct client *client, string_t *cmd,
        str_append_tabescaped(cmd, client->user->set->mail_log_prefix);
        str_printfa(cmd, "\tidle_notify_interval=%u",
                    client->set->imap_idle_notify_interval);
-       if (net_getpeername(client->fd_in, &peer_ip, &peer_port) == 0) {
+       if (net_getpeername(client->fd_in, &peer_ip, &peer_port) == 0 &&
+           peer_port != 0) {
                str_printfa(cmd, "\tpeer_ip=%s\tpeer_port=%u",
                            net_ip2addr(&peer_ip), peer_port);
        }