From: Timo Sirainen Date: Tue, 25 Aug 2015 15:27:44 +0000 (+0300) Subject: imap: Fixed hibernation to work with non-TCP connections. X-Git-Tag: 2.2.19.rc1~187 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4318afaa66e64be5edecef710d66f896d4fc296;p=thirdparty%2Fdovecot%2Fcore.git imap: Fixed hibernation to work with non-TCP connections. Mainly meaning UNIX socket connections from login processes, which are proxying TLS connections. --- diff --git a/src/imap/imap-client-hibernate.c b/src/imap/imap-client-hibernate.c index 1416725530..ea4557d6c2 100644 --- a/src/imap/imap-client-hibernate.c +++ b/src/imap/imap-client-hibernate.c @@ -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); }