title: Best way to maintain consistency while implementing a mail client
body: <p>Sorry if it's not a question conforming to SO standards but I don't really know where else to ask for advice.
  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. </p>
  
  <p>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 ?</p>