By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,864 Members | 1,242 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,864 IT Pros & Developers. It's quick & easy.

smtplib, auth and covad

P: n/a

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:

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)


David Geller

Posted Via Premium Usenet Newsgroup Services
Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.