SMTP server w/o using Twisted framework

Jean-Paul Calderone exarkun at divmod.com
Thu Jul 5 15:21:13 EDT 2007


On Thu, 05 Jul 2007 18:56:49 -0000, _spitFIRE <timid.gentoo at gmail.com> wrote:
>On Jul 5, 1:34 pm, "Jeff McNeil" <j... at jmcneil.net> wrote:
>> If you just want to send mail, you should be able to use the standard
>> smtplib module (http://docs.python.org/lib/module-smtplib.html). If
>> your recipients are on the Internet, you would need to handle MX
>> resolution yourself.
>>
>
>How complicated is to handle the MX resolution by myself? I'm sorry
>that I don't have a clue regarding that. Any pointers would be greatly
>appreciated.

You need to do a DNS MX lookup.  There's nothing in the Python stdlib
which provides this functionality.  There are several libraries available
which do this, though (Twisted among them ;).  You can probably find them
with a little googling.  Beyond that, the rules for processing MX records
are simple and it's not much work to pick the right host once you can do
the MX lookups.

Jean-Paul



More information about the Python-list mailing list