[Patches] [ python-Patches-460112 ] SMTP AUTH patch

noreply@sourceforge.net noreply@sourceforge.net
Mon, 10 Sep 2001 19:52:39 -0700


Patches item #460112, was opened at 2001-09-09 18:29
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=460112&group_id=5470

Category: Library (Lib)
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Gerhard Häring (ghaering)
Assigned to: Nobody/Anonymous (nobody)
Summary: SMTP AUTH patch

Initial Comment:
This patch adds SMTP authentication support to Python's
smtplib module. The methods supported by this patch are
"CRAM-MD5" and "PLAIN". It also adds a new module hmac
for a keyed hash (PEP 247 compatible) to the standard
library. The hmac module is needed for the CRAM-MD5
authentication method, but could also be useful for
IMAP authentication, for example.

I tested this patch against the authenticated SMTP
MTA's Postfix (on my own machine) and qmail (on the
german Freemail provider GMX).

It has one known weakness that I currently don't know
how to fix: the return code in case of a failed
authentication is always 500 "Bad syntax".

Especially the changes to smtlib, but also the new hmac
module would like to be reviewed by experienced RFC
readers, SMTP and/or Python wizards.

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

>Comment By: Gerhard Häring (ghaering)
Date: 2001-09-10 19:52

Message:
Logged In: YES 
user_id=163326

I meanwhile fixed the "syntax error" problem. The cause was
base64.encodestring() adding an extra newline character.

I've updated the patch with documentation and a Misc/NEWS entry.

With this patch, the documentation doesn't correctly build.
I think the cause is the new hmac module. Would somebody
please take a look at it? I've never used the Python doc
system before, so I'm a bit lost at the moment.

The error message when building the docs is:
"""
+++ latex dist
+++ latex2html -init_file dist.l2h -dir
/mnt/data1/src/python/dist/src/Doc/html/dist
/mnt/data1/src/python/dist/src/Doc/dist/dist.tex
+++ perl
/mnt/data1/src/python/dist/src/Doc/tools/node2label.pl *.html
python tools/rewrite.py texinputs/boilerplate.tex
RELEASE=2.2a3 \
<html/index.html.in >html/index.html
cd html && \
 python ../tools/mkmodindex --columns 4 \
         --output modindex.html --address "See <i><a
href=\about.html\>About this document...</a></i> for
information on suggesting changes." \
                 lib/modindex.html mac/modindex.html
                 Traceback (most recent call last):
                   File "../tools/mkmodindex", line 139, in ?
                       main()
      File "../tools/mkmodindex", line 94, in main
          ifp = open(ifn)
    IOError: [Errno 2] No such file or directory:
'lib/modindex.html'
    make: *** [html/modindex.html] Error 1
"""

Thanks.

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

Comment By: Martin v. Löwis (loewis)
Date: 2001-09-09 23:39

Message:
Logged In: YES 
user_id=21627

>From a shallow inspection, the code itself looks ok, 
structurally and from the proposed new features. Please 
indicate whether you are willing to write patches to the 
documentation, since the current patch includes none. In 
particular, the new module deserves a documentation entry; 
copying the doc strings is fine. You may also consider 
writing a Misc/NEWS entry.


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

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