aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog7
-rw-r--r--camel/providers/smtp/camel-smtp-transport.c22
2 files changed, 20 insertions, 9 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 1c5e1de5f5..e79d88f11a 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,10 @@
+2001-05-11 Jeffrey Stedfast <fejj@ximian.com>
+
+ * providers/smtp/camel-smtp-transport.c (smtp_auth): Don't check
+ the initial auth response until we get into the while-loop
+ otherwise we have problems if the SASL mechanism supported a
+ client initiated challenge (like PLAIN and LOGIN do).
+
2001-05-11 Dan Winship <danw@ximian.com>
* camel-stream-null.c (camel_stream_null_new): Make this return
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index 2d07a26b85..c081bd9a13 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -746,20 +746,24 @@ smtp_auth (CamelSmtpTransport *transport, const char *mech, CamelException *ex)
}
g_free (cmdbuf);
- /* get the base64 encoded server challenge which should follow a 334 code */
respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
- if (!respbuf || strncmp (respbuf, "334", 3)) {
- g_free (respbuf);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("AUTH request timed out: %s"),
- g_strerror (errno));
- goto lose;
- }
while (!camel_sasl_authenticated (sasl)) {
- if (!respbuf)
+ if (!respbuf) {
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("AUTH request timed out: %s"),
+ g_strerror (errno));
goto lose;
+ }
+
+ /* the server challenge/response should follow a 334 code */
+ if (strcmp (respbuf, "334")) {
+ g_free (respbuf);
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("AUTH request failed."));
+ goto lose;
+ }
/* eat whtspc */
for (challenge = respbuf + 4; isspace (*challenge); challenge++);