Simple Python script as SMTP server for outgoing e-mails?

Chris Angelico rosuav at
Mon Jul 22 16:15:28 CEST 2013

On Tue, Jul 23, 2013 at 12:08 AM, Michael Torrie <torriem at> wrote:
> On 07/22/2013 06:51 AM, Chris Angelico wrote:
>>> Thanks for the tip. I didn't know about SPF
>> It's a great way of detecting legit vs forged mail. If anyone tries to
>> send mail purporting to be from anything at and the receiving
>> mail server is checking SPF records, it'll be rejected after one cheap
>> DNS lookup. It's a simple and cacheable way to ask the owning server,
>> "Is this guy allowed to send mail for you?". (The 192.168 block in my
>> SPF record above is permitted to allow some intranet conveniences;
>> omit it unless you need it.)
> Yes setting SPF records will help your mail be accepted by other
> servers, but I disagree with your appeal to make mail server SPF
> handling as strict as your server does. SPF has problems in a number of
> situations which could cause legitimate mail to be rejected.  In my last
> job I could only use SPF as one spam factor, not as a basis for rejection.

If legit mail is rejected for failing an SPF check, it's the sending
admin's problem, not yours. You should never have problems with it if
it's set up correctly. And since rejected mail gets reported to the
transmitting MTA, you don't need to drop it in a spambox or anything.
It's not spam, it's simply invalid mail (equivalent to something sent
to a dud address).


More information about the Python-list mailing list