From 7c993b4bf142fa4e15d2c3a3af265736cbd30b1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Wed, 3 Aug 2005 12:07:34 +0000 Subject: [PATCH] makes some strange smtp server like 1und1.de to work. Those send the helo reply in 2 parts, the AUTH=PLAIN... being in the 2nd one which we didn't read... ending up to no login. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13889 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../mail_daemon/outbound_protocols/smtp/smtp.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/add-ons/mail_daemon/outbound_protocols/smtp/smtp.cpp b/src/add-ons/mail_daemon/outbound_protocols/smtp/smtp.cpp index 835115e36e..9faa2f2fda 100644 --- a/src/add-ons/mail_daemon/outbound_protocols/smtp/smtp.cpp +++ b/src/add-ons/mail_daemon/outbound_protocols/smtp/smtp.cpp @@ -926,10 +926,13 @@ SMTPProtocol::ReceiveResponse(BString &out) BString searchStr = ""; struct timeval tv; + struct timeval nulltv; struct fd_set fds; tv.tv_sec = long(timeout / 1e6); tv.tv_usec = long(timeout-(tv.tv_sec * 1e6)); + nulltv.tv_sec = 0L; + nulltv.tv_usec = 0L; /* Initialize (clear) the socket mask. */ FD_ZERO(&fds); @@ -969,6 +972,16 @@ SMTPProtocol::ReceiveResponse(BString &out) len += r; out.Append(buf, r); + + // is there anything else to read ? (smtp.1und1.de sends the 250-AUTH line in a 2nd part) +#ifdef USESSL + if ((use_ssl) && (SSL_pending(ssl))) + continue; + else +#endif + result = select(32, &fds, NULL, NULL, &nulltv); + if (result > 0) + continue; if (strstr(buf, CRLF) && (out.FindFirst(searchStr) != B_ERROR)) break;