PHP IMAP messege_id blank

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hello All,
I am fetching mails from gmail and imap_fetch_overview function
returns array of message information along with message_id that is
only the unique thing to identify message identity. But for some mails
it is blank. So how can I preserve unique identity of the messages as
I am storing them in database. Please help me. Thanks in advance.

Re: PHP IMAP messege_id blank

Quoted text here. Click to load it

Its up to the originating MTA to add a message id - but only if it
wants to.

There is no requirement for a SMTP email to contain a message-id
header, indeed RFC-2821 states:

The following changes to a message being processed MAY be applied
   when necessary by an originating SMTP server, or one used as the
   target of SMTP as an initial posting protocol:

   -  Addition of a message-id field when none appears

So there's no requirement for it to be added. Nor is there any
requirement that it be unique.

Use a surrogate key. Or if you must elminate duplicate messages, a
hash of the headers and body.


Site Timeline