SMTP: Handle 235 code after initial AUTH command.
authorMatthew Barnes <mbarnes@redhat.com>
Fri, 24 Jun 2011 22:51:22 +0000 (18:51 -0400)
committerMatthew Barnes <mbarnes@redhat.com>
Fri, 24 Jun 2011 22:55:47 +0000 (18:55 -0400)
The server may accept the initial response in our AUTH command and
return a 235 (success) code without a 334 (continue) code, such as
for example with XOAUTH.  Handle this correctly.

camel/providers/smtp/camel-smtp-transport.c

index 40c95e9..5c7c95d 100644 (file)
@@ -1210,6 +1210,10 @@ smtp_auth (CamelSmtpTransport *transport,
                        goto lose;
                }
 
+               /* the server may have accepted our initial response */
+               if (strncmp (respbuf, "235", 3) == 0)
+                       break;
+
                /* the server challenge/response should follow a 334 code */
                if (strncmp (respbuf, "334", 3) != 0) {
                        smtp_set_error (