Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm writing a python program to send emails, and when trying to send to yopmail, hotmail and some other hosts the connection gets closed by the server without a message. I tried connecting directly with netcat and the same thing happens. Here's what the exchange looks like :

$ nc smtp.yopmail.com 25
220 mx.yopmail.com ESMTP ***
ehlo mx.myhost.com
250 SIZE 2048000
mail FROM:<user@myhost.com>
250 OK
rcpt TO:<test@yopmail.com>    

The connection is just closed abruptly at this point. On other hosts, like my ISP's, everything goes fine. I've checked the blacklists but my IP is not listed. Any idea what's going on?

Edit: My IP is not listed in any blacklist. I own myhost.com, but I don't have an SPF record. I'll add one and update this post when the record has propagated.

Edit 2: with the SPF added the email is now accepted and Hotmail adds a Authentication-Results: hotmail.com; sender-id=pass header to the email. However it gets classified as spam, but I guess that's another matter. Thanks for your help.

share|improve this question
First check whether your IP address is listed on any DNSBL. Check whether your script is working from another address (I maintain an SDF shell account for such reasons). –  adamo Apr 5 '12 at 9:42

1 Answer 1

up vote 1 down vote accepted

Chances are this is their spam countermeasures kicking in. Depending on where you're connecting from etc. email servers will reject accepting mail from you for lots of different reasons. There may be a spf record for myhost.com saying hotmail should only accepting mail purporting to be from myhost.com if it comes from a certain address. So connecting from your home net connection will cause it to fail. Or when their mail server does a reverse lookup on your IP it doesn't match the from address.

Different providers are pickier than others over accepting mail. If you don't think this is what is happening, update your answer with more info (is myhost.com your server, have you got an spf record, is your reverse DNS set correctly etc.).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.