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.c18
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;
}