*
The moose likes Other JSE/JEE APIs and the fly likes Most reliable method to achieve mail download / sync consistency Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Most reliable method to achieve mail download / sync consistency " Watch "Most reliable method to achieve mail download / sync consistency " New topic
Author

Most reliable method to achieve mail download / sync consistency

Aneesh Mohan
Greenhorn

Joined: Jan 24, 2014
Posts: 6
I'm implementing a mail client which downloads all mails and stores them locally. Any mail deleted locally should be reflected in the online inbox and vice versa. Also if the download of mail stops before all mails are downloaded, it should resume from the stopped mail next time.

Currently I'm using a combination of message id and message uid for this but I heard it's not a reliable method for this. Can you guys suggest me any other approach ?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41621
    
  55
That sounds pretty much like IMAP works. Which protocol are you using to access the server?


Ping & DNS - my free Android networking tools app
Aneesh Mohan
Greenhorn

Joined: Jan 24, 2014
Posts: 6
Ulf Dittmer ,
I'm using both IMAP and POP3 and in both the protocols, I'm following the message-id approach. Is this the only approach applicable to IMAP ?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41621
    
  55
I'm using both IMAP and POP3 and in both the protocols

This sounds odd. POP has no concept of synchronization, so you're bound to run into problems, especially if you also (or variously) use IMAP.
Aneesh Mohan
Greenhorn

Joined: Jan 24, 2014
Posts: 6
Ulf Dittmer wrote:
I'm using both IMAP and POP3 and in both the protocols

This sounds odd. POP has no concept of synchronization, so you're bound to run into problems, especially if you also (or variously) use IMAP.



Ok I should mention that POP3 is there as fallback for certain sites which only support POP3 ( like Outlook) . I don't use sync here but I do use message-id to identify messages.
But with IMAP as I said, message-id is being used.
Suppose I have a fully sync list of mails in my local machine. Now, If I delete a mail in the inbox, how can I identify this event so that I can also delete the local copy automatically? Is it just a matter of comparing the message-uids of local and server mails and delete whatever is missing in the server?
 
jQuery in Action, 2nd edition
 
subject: Most reliable method to achieve mail download / sync consistency