Email from php being rejected by outlook.com

Hi all,

I have a problem whereby emails generated by php are being rejected by outlook.com. They don’t even find their way into the Junk folder - they just don’t arrive. And we don’t get any rejection message back from outlook.com.

The server’s hostname is server12345.provider.com and the from address is user@mydomain.com. Therefore I have added server12345.provider.com as an allowed domain within the SPF record for mydomain.com.

When I send an email from a mail client (in this case Mac Mail) authenticating through postfix as user@mydomain.com, the message arrives at outlook.com no problem. But when php is the sender, it never gets there.

Even if the outlook.com user adds user@mydomain.com to their trusted senders, that makes no difference.

(This is not a php problem, as its message to anything other than outlook.com arrive no problem.)

This is causing real headaches as we have 245,000 users and no-one can reset their password if they are at a live.com, hotmail.com or outlook.com address (which is a good proportion of those users).

There’s obviously something about these php generated emails that outlook.com doesn’t like. Anyone have any ideas as to how I could troubleshoot what it is?

Howdy,

Well, let’s start here… if you look in the email logs – either /var/log/mail.log or /var/log/maillog, what do you see in there during the delivery process? Is the remote mail server offering any errors?

Or does it show them accepting the email?

-Eric

Hi Eric,

I see this:

May 27 16:14:01 server56938 postfix/sendmail[3144]: fatal: irbpassport(501): No recipient addresses found in message header

So to clarify, if I run the php script with my email address as the recipient, I receive the email no problem. In the mail log, I see:

May 27 16:13:55 server56938 postfix/pickup[1448]: C670C2486983: uid=501 from=<irbpassport>
May 27 16:13:55 server56938 postfix/cleanup[3139]: C670C2486983: message-id=<20130527151355.C670C2486983@server56938.uk2net.com>
May 27 16:13:55 server56938 postfix/qmgr[19035]: C670C2486983: from=<irbpassport@server56938.uk2net.com>, size=1335, nrcpt=1 (queue active)
May 27 16:13:56 server56938 postfix/smtp[3143]: C670C2486983: to=<adam@first-light.biz>, relay=mail.first-light.biz[93.89.137.145]:25, delay=0.4, delays=0.25/0/0.06/0.08, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as B19B82A0D94)
May 27 16:13:56 server56938 postfix/qmgr[19035]: C670C2486983: removed

When I run it with a hotmail.com or outlook.com address, I get the error.

Any thoughts?

Hmm, that’s an unusual error… so just to clarify, you’re saying that if you were to send that to, say, a Gmail.com address, that it correctly arrives in that Gmail account?

-Eric

Well, it ends up in spam folder, which is something I’d like to solve in the long term… but for now, yes, it gets there.

Howdy,

Well, it’s tough to say exactly why this is the case, but the error you’re seeing seems to suggest that there’s something malformed in the headers in certain cases.

Is it possible to get a copy of the email that it’s generating when sending to the outlook.com site?

For example, is there maybe a debug setting that shows the entire email contents?

-Eric

OK - thanks Eric. When running the same site on a testing server with error reporting turned on, I now realize that the particular address I was testing with returned two rows from my database, resulting a malformed header.

OK so that’s that problem parked. Now I’ll start a new thread about what the original problem was - that of getting message into the user’s inbox and avoiding being marked as spam.