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

Chris Angelico rosuav at
Mon Jul 22 14:51:12 CEST 2013

On Mon, Jul 22, 2013 at 10:38 PM, Gilles <nospam at> wrote:
> On Mon, 22 Jul 2013 22:29:42 +1000, Chris Angelico <rosuav at>
> wrote:
>>One thing to check when you change how you send mail is your SPF
>>record. I run the mail server for and have set its SPF to:
>>"v=spf1 ip4: ip4: ip4: -all"
>>If your SPF is as strict as mine (and if it's not, please make it so,
>>for the sake of the rest of the world!), you'll want to check it
>>before you start sending mail directly from your own computer.
>>Otherwise your mail _will_ be rejected as spam.
> 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.)


More information about the Python-list mailing list