0

I am developing simple program that will download my emails from different mail boxes and store in database for backup.

I plan to use IMAP and most mailboxes are gmail.

I am wondering how do I avoid dupes?

I read that IMAP's UID is not reliable. Message-ID is not guaranteed to be unique. Email's hash may change. (Some mail servers may modify emails header)

What is common and practical pattern usually used?

I do not wish to get tons of dupes and I do not wish to loose emails.

Also it would be automated script used for backup. I do not wish to manually verify it daily.

Max
  • 6,286
  • 5
  • 44
  • 86
  • 1
    What is wrong with UIDs? As long as you're in a single folder, UIDs have to be reliable or it is not possible to do any sort of persistent caching. A full unique identifier for a message is the folder identifier, the UIDVALIDITY, and the UID: e.g. (INBOX:773827384:122). You may need to track server and login name as well. – Max Jul 15 '14 at 17:20
  • 1
    Max: Some/many versions of Exchange have odd behaviour with respect to UIDs. Othermax: All other current-day servers have sensible and reliable UIDs. – arnt Jul 16 '14 at 09:47
  • Oh, two Maxes. That's confusing. Sorry :) – Max Jul 17 '14 at 15:18

0 Answers0