diff --git a/src/account/imap4.c b/src/account/imap4.c index ff84446..6af5ecb 100644 --- a/src/account/imap4.c +++ b/src/account/imap4.c @@ -1206,7 +1206,8 @@ static gboolean _on_connect(gpointer data) return FALSE; } /* create the socket */ - if((imap4->fd = socket(ai->ai_family, ai->ai_socktype, 0)) == -1) + if((imap4->fd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol)) + == -1) { helper->error(helper->account, strerror(errno), 1); _imap4_stop(imap4); diff --git a/src/account/pop3.c b/src/account/pop3.c index daa5de1..fbaf965 100644 --- a/src/account/pop3.c +++ b/src/account/pop3.c @@ -666,7 +666,8 @@ static gboolean _on_connect(gpointer data) return FALSE; } /* create the socket */ - if((pop3->fd = socket(AF_INET, SOCK_STREAM, 0)) == -1) + if((pop3->fd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol)) + == -1) { helper->error(helper->account, strerror(errno), 1); _pop3_stop(pop3);