I have a mail account with 5000 messages, the old ones are 4 years old. I login to that account with a web interface and with thunderbird. I delete a very old mail in the web interface. Then I press refresh (get mails) on the thunderbird without relogin. Thunderbird immediately deletes the message. How can detect thunderbird the deleted message so quickly? I have to implement so mechanism in java (java mail api), I think I have to fetch all mails, and have to store already fetched mails in the local, then I have to compare each one by-one. As I know, the message id property is not secure, hence it can be changed when I move one message to another, they are not secure. The best way is using message id stored in the header or using a custom cache mechanism as stated in:I have a mail account with 5000 messages, the o