This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: smtplib login fails with aol smtp server
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 2.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder: smtplib: add support for arbitrary auth methods
View: 15014
Assigned To: Nosy List: aptshansen, ps1956, r.david.murray
Priority: normal Keywords: patch

Created on 2006-07-12 13:32 by ps1956, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
all.patch ps1956, 2006-07-12 13:32 2.4.3 smtplib patch
smtplib.patch ps1956, 2007-04-04 10:31 updated patch against svn trunk
Messages (4)
msg50680 - (view) Author: Peter (ps1956) Date: 2006-07-12 13:32
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).
msg50681 - (view) Author: Stephen Hansen (aptshansen) Date: 2007-03-16 06:21
This seems reasonable to me; the preference of which authentication modes to use shouldn't be a hardcoded decision in smtplib, especially if one of the biggest email servers around breaks if we can't.

However, I think it needs a couple things done before it should be accepted:
  #1) The code patch itself needs to be done against the trunk, as it doesn't currently apply cleanly (it's a trivial fix)
  #2) The documentation patch should include mention of the "constants" of smtplib.AUTH_*
msg50682 - (view) Author: Peter (ps1956) Date: 2007-04-04 10:31
File Added: smtplib.patch
msg216347 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-04-15 17:53
This will be fixed as part of issue 15014, which also adds support for providing user created auth methods.
History
Date User Action Args
2022-04-11 14:56:18adminsetgithub: 43659
2014-04-15 17:53:02r.david.murraysetstatus: open -> closed
superseder: smtplib: add support for arbitrary auth methods
messages: + msg216347

resolution: duplicate
stage: test needed -> resolved
2011-01-06 16:50:03pitrousetnosy: + r.david.murray
2009-03-30 05:06:02ajaksu2setstage: test needed
type: enhancement
versions: + Python 2.7, - Python 2.4
2006-07-12 13:32:50ps1956create