2

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:<[email protected]>
250 OK
rcpt TO:<[email protected]>    

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.

1
  • 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, 2012 at 9:42

1 Answer 1

2

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.).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .