twisted mail server - SMTP AUTH extension not supported

Mark Carter cartermark46 at
Tue Dec 30 20:05:53 CET 2003

I'm trying to create a mail server in Twisted.

I either get 
SMTPException: SMTP AUTH extension not supported by server. 

What do I need to do to get it to work?

--- Here is the server:

from twisted.internet import reactor

from twisted import mail
import twisted.mail.mail
import twisted.mail.maildir

service = mail.mail.MailService('ExampleMail')
smtp = service.getSMTPFactory()
pop3 = service.getPOP3Factory()

domain = mail.maildir.MaildirDirdbmDomain(service, '/temp')
domain.addUser('salvador', 'gala')
service.addDomain('dali', domain)

reactor.listenTCP(25, smtp , interface='dali')
reactor.listenTCP(110, pop3 , interface='dali')

--- Here is the client that tries to send an email:

import smtplib
from email.MIMEText import MIMEText
addr = 'salvador at dali'

msg = MIMEText('Body of message')
msg['From'] = addr 
msg['Subject'] = 'Note to myself'
msg['To'] = addr

server = smtplib.SMTP('dali')
server.login('salvador', 'gala') # see note 1
server.sendmail(addr, addr ,msg.as_string())

--- Notes:

1. If I keep in the line:
server.login('salvador', 'gala') # see note 1
the client complains:
    server.login('salvador', 'gala')
  File "C:\Python23\lib\", line 546, in login
    raise SMTPException("SMTP AUTH extension not supported by
SMTPException: SMTP AUTH extension not supported by server.

If I comment it out, the client complains:
SMTPSenderRefused: (451, 'Requested action aborted: error in
processing', 'salvador at dali')
and the server prints the message:
Failure: twisted.cred.error.UnhandledCredentials: No checker for
... DeprecationWarning:
 Returning None from validateFrom is deprecated. Raise
 "Raise smtp.SMTPBadSender instead", DeprecationWarning"

More information about the Python-list mailing list