smtplib, auth and covad

Discussion in 'Python' started by David Geller, Nov 18, 2004.

  1. David Geller

    David Geller Guest

    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
     
    David Geller, Nov 18, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Q2hyaXMgTW9oYW4=?=

    Configuring Windows Auth & Forms Auth in Asp.Net

    =?Utf-8?B?Q2hyaXMgTW9oYW4=?=, Apr 28, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    725
    =?Utf-8?B?Q2hyaXMgTW9oYW4=?=
    Apr 28, 2004
  2. =?Utf-8?B?ZGhucml2ZXJzaWRl?=

    Windows Auth, but Forms Auth for one page?

    =?Utf-8?B?ZGhucml2ZXJzaWRl?=, Jan 8, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    592
    Elton Wang
    Jan 8, 2005
  3. Curt_C [MVP]

    COVAD Referral Program!

    Curt_C [MVP], Mar 2, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    1,256
    Kevin Spencer
    Mar 2, 2005
  4. Evan
    Replies:
    3
    Views:
    490
  5. cs

    Form Auth and windows int auth

    cs, Apr 18, 2006, in forum: ASP .Net Security
    Replies:
    1
    Views:
    120
    Timothy H. Schilbach
    Apr 28, 2006
Loading...

Share This Page