Archived Forum Post

Index of archived forum posts

Question:

CkoEmail Uidl propperty returns empty string

Apr 30 '13 at 11:56

The Uidl propperty of CkoEmail always returns an empty string.

Any help appreciated.


Answer

I wasn't 100% correct in my last answer. The UIDL will be available if downloaded from a POP3 server such that the UIDLs were previously fetched - which can happen implicitly depending on how the emails are fetched. You can force this by calling GetUidls before downloading emails.

The reason it's not done automatically for FetchByMsgnum is because of this: If a large number of emails are in the POP3 mailbox, and the intent is to only download a single email, the overhead of issuing the UIDL command to retrieve a potentially large amount of data would be too much.


Answer

A Chilkat email object would only have a UIDL if it came into existence by downloading it from a POP3 server via the Chilkat API. If it was downloaded from an IMAP server, it won't have a UIDL. If it was loaded from a .eml file or via some other means, then it won't have a UIDL. When Chilkat downloads an email from POP3, it will add the "X-UIDL" header so that the email can be associated with a UIDL in the POP3 mailbox.


Answer

All emails are actually downloaded from different POP3 servers via:

CkoEmail *email = [self.mailman FetchByMsgnum:mailNum];

The Uidl propperty is always empty. As I find out which emails have to be downloaded by comparing uidl's of already saved emails, this causes my application to always download all emails from the server.