| Author |  | 
      
        | cusimar9 Newbie
 
  
 
 Joined: 23 February 2009
 Online Status: Offline
 Posts: 5
 | 
          I've used the POP3 component to download all UID from a POP3 server and only
           | Posted: 05 April 2011 at 9:25am | IP Logged |   |  
           | 
 |  download messages to a local database which have not already been downloaded.
 
 This seems to work quite well.
 
 However I'm struggling to see the 'higher level' view of how I could synch my
 database with the IMAP server.
 
 I've used the Search() method to find UNSEEN messages or messages SINCE <date>,
 this is OK, but with IMAP I have to be able to synch the entire folder because
 the user could have replied to an email from (say) 3 months back.
 
 Surely I don't want to download ALL envelopes? Or should I download all the
 message headers, will they include the UID?
 
 Can I have some advice on how I could synch to an IMAP account with a local
 database?
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          Downloading all the envelopes should be fine, as long as you specify only particular envelope parts you require. In your scenario,
           | Posted: 06 April 2011 at 5:50am | IP Logged |   |  
           | 
 |  that would be just EnvelopeParts.Uid and maybe also EnvelopeParts.Flags:
 
 
 
| Code: 
 
    
    | 
      
       | EnvelopeCollection envs = imp.DownloadEnvelopes(Imap.AllMessages, false, EnvelopeParts.Flags | EnvelopeParts.Uid, 0); |  |  |  
 This would get you the envelopes list, each of those comes with Uid property of course.
 
 --
 Regards,
 Igor, AfterLogic Support
 | 
       
        | Back to Top |     | 
       
       
        |  |