How can I calculate a unique id string for each email in an IMAP account?
I am making a script which must frequently copy all missing mails from one IMAP account to another one. I want to avoid making duplicates on each update, so I have to identify what is on one account and what is on the other.
Not all emails have a message_id
, and I can't see what the difference between message_id
and uid
is - can anybody tell me?
It seems to me that the message_id
is not changed when using imap_append - can anybody confirm that?
When generating a unique id string for each email there is many other options than just the message id, fx email title and date, but I don't know what to pick: http://www.php.net/manual/en/function.imap-headerinfo.php
From
,Date
&Size
) might give unique combination. Sadly very few who has worked with PHP-IMAP don't update examples in Manuals. – Maroniteimap_uid()
returnmessage_id
? What does it return for emails withoutmessage_id
? – Maronitemessage_id
? Humans can't do it, machines(automated) can! – Maronite