Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > smtplib, auth and covad

Reply
Thread Tools

smtplib, auth and covad

 
 
David Geller
Guest
Posts: n/a
 
      11-18-2004
Hi,

I had been using smptlib to send email via my covad relay previously (several months ago), and it worked fine. Covad requires authentication, and this was accomplished fine with smtp.login(usrname, pwd).

Today when I tried the program, it stopped working. Using the smtp debug option, I determined that when

send: 'AUTH PLAIN abcdef\r\n'

I would get the exception:

smtplib.SMTPServerDisconnected: Connection unexpectedly closed


Soooooo, it turns out that the covad mail server does not like to have the base64 username/password in the same line as the AUTH PLAIN. While it appears that the RFC2554 allows for this, covad does not (anymore).

I had to modify smtplib.login() to do the following:

send 'AUTH PLAIN'
wait for status code 334
send the base64 username/password
wait for status code 235

--------------------------------------- CODE
elif authmethod == AUTH_PLAIN:
(code, resp) = self.docmd("AUTH", AUTH_PLAIN)
if code != 334:
raise SMTPAuthenticationError(code, resp)
(code, resp) = self.docmd(encode_plain(user, password),"")
-------------------------------------------------

Question: should the official smtplib be modified to allow for this situation?

(Python 2.3)

Thanks!

David Geller

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cisco 2620 with WIC-1ADSL with Covad /29 Block BlueMonkeyFish Cisco 8 02-24-2007 03:35 PM
windows auth and forms auth Smokey Grindle ASP .Net 1 06-08-2006 03:14 PM
Form Auth and windows int auth cs ASP .Net Security 1 04-28-2006 03:05 PM
COVAD Referral Program! Curt_C [MVP] ASP .Net 5 03-02-2005 09:31 PM
COVAD Referral Program! None Computer Information 0 03-02-2005 08:14 PM



Advertisments