diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-03-14 07:44:29 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-03-14 07:44:29 +0800 |
commit | 1d0160ac11ca74d21207f4c51fe57028d3c12dee (patch) | |
tree | c016d32854a6866812e4415ef982f33dd97327db | |
parent | c7f94b862e774a3b41030829e6d6251e9ce6fd02 (diff) | |
download | gsoc2013-evolution-1d0160ac11ca74d21207f4c51fe57028d3c12dee.tar gsoc2013-evolution-1d0160ac11ca74d21207f4c51fe57028d3c12dee.tar.gz gsoc2013-evolution-1d0160ac11ca74d21207f4c51fe57028d3c12dee.tar.bz2 gsoc2013-evolution-1d0160ac11ca74d21207f4c51fe57028d3c12dee.tar.lz gsoc2013-evolution-1d0160ac11ca74d21207f4c51fe57028d3c12dee.tar.xz gsoc2013-evolution-1d0160ac11ca74d21207f4c51fe57028d3c12dee.tar.zst gsoc2013-evolution-1d0160ac11ca74d21207f4c51fe57028d3c12dee.zip |
Added a work-around for SMTP servers that can't read the RFCs and thus
2002-03-13 Jeffrey Stedfast <fejj@ximian.com>
* providers/smtp/camel-smtp-transport.c (smtp_auth): Added a
work-around for SMTP servers that can't read the RFCs and thus
implement SASL incorrectly. Oh well, that's life in the world of
mail clients I guess.
svn path=/trunk/; revision=16152
-rw-r--r-- | camel/ChangeLog | 7 | ||||
-rw-r--r-- | camel/providers/smtp/camel-smtp-transport.c | 18 |
2 files changed, 24 insertions, 1 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index febd54bee1..c4b707e472 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,10 @@ +2002-03-13 Jeffrey Stedfast <fejj@ximian.com> + + * providers/smtp/camel-smtp-transport.c (smtp_auth): Added a + work-around for SMTP servers that can't read the RFCs and thus + implement SASL incorrectly. Oh well, that's life in the world of + mail clients I guess. + 2002-03-12 Jeffrey Stedfast <fejj@ximian.com> * camel-digest-store.c (camel_digest_store_new): Now takes a url diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c index 0c331bb673..d0b257cd6b 100644 --- a/camel/providers/smtp/camel-smtp-transport.c +++ b/camel/providers/smtp/camel-smtp-transport.c @@ -970,6 +970,7 @@ static gboolean smtp_auth (CamelSmtpTransport *transport, const char *mech, CamelException *ex) { char *cmdbuf, *respbuf = NULL, *challenge; + gboolean auth_challenge = FALSE; CamelSasl *sasl = NULL; camel_operation_start_transient (NULL, _("SMTP Authentication")); @@ -984,10 +985,12 @@ smtp_auth (CamelSmtpTransport *transport, const char *mech, CamelException *ex) challenge = camel_sasl_challenge_base64 (sasl, NULL, ex); if (challenge) { + auth_challenge = TRUE; cmdbuf = g_strdup_printf ("AUTH %s %s\r\n", mech, challenge); g_free (challenge); - } else + } else { cmdbuf = g_strdup_printf ("AUTH %s\r\n", mech); + } d(fprintf (stderr, "sending : %s", cmdbuf)); if (camel_stream_write (transport->ostream, cmdbuf, strlen (cmdbuf)) == -1) { @@ -1018,6 +1021,15 @@ smtp_auth (CamelSmtpTransport *transport, const char *mech, CamelException *ex) goto lose; } + if (FALSE) { + broken_smtp_server: + d(fprintf (stderr, "Your SMTP server's implementation of the %s SASL\n" + "authentication mechanism is broken. Please report this to the\n" + "appropriate vendor and suggest that they re-read rfc2222 again\n" + "for the first time (specifically Section 4, paragraph 2).\n", + mech)); + } + /* eat whtspc */ for (challenge = respbuf + 4; isspace (*challenge); challenge++); @@ -1043,6 +1055,10 @@ smtp_auth (CamelSmtpTransport *transport, const char *mech, CamelException *ex) /* check that the server says we are authenticated */ if (!respbuf || strncmp (respbuf, "235", 3)) { + if (respbuf && auth_challenge && !strncmp (respbuf, "334", 3)) { + /* broken server, but lets try and work around it anyway... */ + goto broken_smtp_server; + } g_free (respbuf); goto lose; } |