SMTP authentication

Thomas Wouters thomas at xs4all.net
Tue Aug 15 06:39:17 EDT 2000


On Tue, Aug 15, 2000 at 01:15:06AM -0400, Meursault wrote:

> Can someone give me some advice on how to do SMTP authentication with
> smtplib.py? 

> The server lists extensions of 'PIPELINING', '8BITMIME' and
> 'AUTH=LOGIN' at connection.  An SMTP library command of
> server.docmd('auth', 'login') will make the server prompt for a
> username in Base64 (reply: '334 VXNlcm5hbWU6\015\012'), but I have no
> idea how to consummate the authentication. Any suggestions?

That has less to do with smtplib.py and more with the RFC on SMTP
authentication. You can de-code the base64 reply using the (suprise!) base64
module, encode your response and send it with another docmd or putcmd. If
you have the time and think it could be useful, I'm pretty sure a patch to
add support for SMTP auth to the smtplib module would be accepted :-) If I
had the time to read the SMTP auth RFC I would add it myself, but I won't
have that time anytime soon.

-- 
Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!




More information about the Python-list mailing list