Thank you Olivia, I appreciate the advice.
However, I don’t want to “download messages for offline use”, as this would consume a large amount of space on my local PC.
With IMAP protocol, it is not necessary to download messages to determine unread messages. Allow me demonstrate how simple it is, using a raw telnet session connecting to a demo email account with 5 emails, several of which are unread…
(Note for the casual observer… this “language” and sequence of commands is how emClient and other email clients communicate “under the hood”, “behind the scenes” with your email server)
(commands that I enter are in bold , the server’s responses of interest are in _ bold _, and any of my comments are bold and underlined )
$ telnet mymailserver.com imap
Trying 56.23.45.78…
Connected to mymailserver.com.
Escape character is ‘^]’.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE NAMESPACE STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
LOGIN [email protected] mypassword
a OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE NAMESPACE SPECIAL-USE COMPRESS=DEFLATE QUOTA] Logged in
a LIST “” “*”
* LIST (\HasChildren) “.” INBOX
* LIST (\HasNoChildren \Junk) “.” INBOX.Junk
* LIST (\HasNoChildren \Sent) “.” INBOX.Sent
* LIST (\HasNoChildren \Drafts) “.” INBOX.Drafts
* LIST (\HasNoChildren \Trash) “.” INBOX.Trash
* LIST (\HasNoChildren \Archive) “.” INBOX.Archive
a OK List completed (0.000 + 0.000 secs).
a examine INBOX
* OK [CLOSED] Previous mailbox closed.
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS ()] Read-only mailbox.
* 5 EXISTS
* 0 RECENT
* OK [UNSEEN 4] First unseen.
* OK [UIDVALIDITY 1371737469] UIDs valid
* OK [UIDNEXT 10] Predicted next UID
* OK [HIGHESTMODSEQ 14] Highest
a OK [READ-ONLY] Examine completed (0.000 + 0.000 secs).
a SEARCH UNSEEN
* SEARCH 4 5
a OK Search completed (0.001 + 0.000 secs).
a EXAMINE INBOX.Trash
* OK [CLOSED] Previous mailbox closed.
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS ()] Read-only mailbox.
* 1 EXISTS
* 0 RECENT
* OK [UNSEEN 1] First unseen.
* OK [UIDVALIDITY 1371737473] UIDs valid
* OK [UIDNEXT 2] Predicted next UID
* OK [HIGHESTMODSEQ 2] Highest
a OK [READ-ONLY] Examine completed (0.000 + 0.000 secs).
a SEARCH UNSEEN ** **
* SEARCH 1
a OK Search completed (0.001 + 0.000 secs).
As you can plainly see, there are:
- 2 unread messages (#4 and #5) in Inbox
- 1 unread message in Trash
So, this demonstrates how very simple it is for the email client to determine unread message counts for any folder. There is no need to “download messages for offline”.
Why can’t emClient do this? Many other email clients do this (Thunderbird, etc)
-Matthew