IMAP: (JavaMail) UIDVALIDTY values โ€‹โ€‹always change some folders

We have implemented a mail client using the JavaMail api, which connects to the mail server to process IMAP messages. Efficiency works great on many clients and mail servers, but one client has a problem,

UIDVALIDTY: To determine if we can rely on the UID values โ€‹โ€‹of messages in a folder, we store the last UIDVALIDTY for each folder. And in the next process, we compare the last stored value with the current one. If they are the same, we can rely on the UID. The IMAP specification requires servers to do their best to avoid unnecessary changes to this value. (Except for mail server crash, reboot, upgrade, etc.)

On this particular client mail server, the UIDVALIDTY values โ€‹โ€‹of some folders change every time. The test account has 300 folders, of which 15 of them always have the same specific folders, always have different UIDVALIDTY values.

What could be the reason for this? Is there a mail server setting? I think this is outside the scope of the java mail api, it has to do with the mail server. The client says that we have no problem with our mail server and we can use it with our web interface. How can I convince a client that there is a problem with their mail server?

+3


source to share


1 answer


Some mailbox formats don't have a place to store UIDs, and I think a few of the supported servers support such formats. Dovecot noticeably supports many storage formats, including IIRC, which does not support UIDs.



If the server needs to, it will send you a UIDNOTSTICKY response code when you open your mailbox , and from that point on it will call new UIDS out of thin air. You may find UIDNOTSTICKY and refuse to play, or simply see it as an opportunity to test your handling of a reality change.

+3


source







All Articles