ddeboer / imap

Object-oriented, fully tested PHP IMAP library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unique number ?

guldil opened this issue · comments

First of all I would like to thank you for this library, it works really well (I tested several of them...). Especially in terms of performance!

I am stuck with the notion of "ID / MessageID" indeed I have messages without ID, so I was wondering if the getNumber() was really unique between the different IMAP sessions or if it is just during the current session.

Best regards

Guldil

Hi, the message number is the one returned by imap_uid function: https://www.php.net/manual/en/function.imap-uid.php

Hello,
Beginner question:

What is the identifier that one can rely on ? meaning the id that all the messages have and never change ?

Based on php.net manual page imap-uid can change in some circumstance and based on my experience some emails may not have getId();


well i could use message_id from header getId(); if applicable but not sure what to do with the ones that are missing it.

The UID is the only thing we have, sorry 🤷

@Boffice we do calculate a hash of each email with subject, from, date and other parameters and use this to identify mails even if they are moved to other folders or between imap servers (uid will change in this case)