fetchmail-friends
[Top] [All Lists]

[fetchmail]fetchmail and email clients

2002-03-13 02:44:51
Hi,

One common problem when a mailbox is accessed through both fetchmail
(with keep option) and an email client is that when a mail which has
been viewed through the email client does not get downloaded.

One solution for imap is to use an alternate flag. The FLAGS are
declared by the imap server during SELECT:

IMAP> A0003 SELECT "INBOX"^M 
...
IMAP< * FLAGS (\Answered \Flagged \Deleted \Draft \Seen) 
IMAP< * OK [PERMANENTFLAGS (\* \Answered \Flagged \Deleted \Draft \Seen)] 
Permanent flags 
...
IMAP< A0003 OK [READ-WRITE] SELECT completed 

Any of the flags (except SEEN and DELETED) can then be used as a check
for mail which has not been downloaded yet. For example, if the user
says that the DRAFT flag should be used (and DRAFT is one of the FLAGS
declared above), the following commands can be issued:

SEARCH UNDRAFT 
....
(in loop)
FETCH 1 RFC822.HEADER 
FETCH 1 BODY[TEXT] 
STORE 1 +FLAGS (\Draft) 
....

This is similar to the SEEN flag except that the STORE at
the end is not required for SEEN as the SEEN flag is automatically
set.

Should this feature be added to fetchmail?

Sunil Shetye.


<Prev in Thread] Current Thread [Next in Thread>