[Patches] [ python-Patches-1521196 ] smtplib login fails with aol smtp server

SourceForge.net noreply at sourceforge.net
Wed Jul 12 15:32:50 CEST 2006


Patches item #1521196, was opened at 2006-07-12 09:32
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1521196&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Peter (ps1956)
Assigned to: Nobody/Anonymous (nobody)
Summary: smtplib login fails with aol smtp server

Initial Comment:
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).


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1521196&group_id=5470


More information about the Patches mailing list