what's the issue with Message-Id in email sent by php

Oleg picture Oleg · Jan 23, 2013 · Viewed 20.5k times · Source

I have suspicious message-id header of email sent by php to gmail account:

Message-Id: <[email protected]>

Could you please tell does it have this strange format and what SMTPIN_ADDED_MISSING means here? Examples I saw in the internet had format something like this containing sending domain but my message id doesn't contain it for some reason:

[email protected]

I don't think I set this header in Zend_Mail. What generates this headers? Do you see any issues with this header?

Answer

Sammitch picture Sammitch · Jan 23, 2013

A proper outbound email client should be generating the Message-ID header when the email is sent. Google is being 'nice' and generating it for you when the message passes through its email system, but most won't, and most spam filters will take this missing header as an indication that the message is more likely to be spam. Any malformed or missing headers will add to the "spam score".

It is not difficult to generate, all that is required is that it is unique per-message:

$message-id = time() .'-' . md5($sender . $recipient) . '@' $_SERVER['SERVER_NAME'];

Or

$message-id = time() .'-' . md5($sender . $recipient) . '@yourdomain.com';

Gives:

[email protected]