Message50680
Sending email to AOL's smtp server fails with "501
INVALID SASL FORMAT OR LENGTH".
This patch allows the default order (AUTH_CRAM_MD5,
AUTH_PLAIN, AUTH_LOGIN) used to select the AUTH method
to be overridden with a new optional preferred_auths
parameter. By changing the order so that AUTH_LOGIN
comes before AUTH_PLAIN, AOL's smtp server is happy.
This patch may be useful for other stmp servers that
fail on login when using the default AUTH selection order.
Sample usage:
if aol:
auths = [smtplib.AUTH_CRAM_MD5, smtplib.AUTH_LOGIN,
smtplib.AUTH_PLAIN]
smtp.login(fromUser.split("@")[0], passwd, auths)
else:
smtp.login(fromUser, passwd)
I tested the patch using python 2.4.3 on slackware 10.2
(kernel 2.4.32).
|
|
Date |
User |
Action |
Args |
2007-08-23 15:53:31 | admin | link | issue1521196 messages |
2007-08-23 15:53:31 | admin | create | |
|