twisted mail server - SMTP AUTH extension not supported
Jp Calderone
exarkun at intarweb.us
Tue Dec 30 17:16:32 EST 2003
On Tue, Dec 30, 2003 at 11:05:53AM -0800, Mark Carter wrote:
> I'm trying to create a mail server in Twisted.
>
> I either get
> SMTPSenderRefused
> or
> 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')
If you want unauthenticated users to be able to send mail, you need to
explicitly allow it.
from twisted.cred import checkers
service.smtpPortal.registerChecker(checkers.AllowAnonymousAccess())
> smtp = service.getSMTPFactory()
SMTP AUTH is really part of ESMTP. Try service.getESMTPFactory() instead
of 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')
>
> reactor.run()
>
Also, note that the above code accomplishes roughly the same thing as the
following command line:
mktap mail --maildirdbmdomain dali=/temp --default \
--user salvador=gala \
--pop3 110 --smtp 25
If you just want a mail server, using the command line is probably better.
If you need more flexibility than it can offer, sticking with code is the
right choice.
Jp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: Digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20031230/e34026dd/attachment.sig>
More information about the Python-list
mailing list