From: Lars T. <ls...@gm...> - 2006-05-15 18:46:27
|
Hello Matthias, Matthias Andree wrote: > Lars Tewes <ls...@gm...> writes: > >> Using fetchmail successfully with polling by interval for several months >> I just tried to use the IMAP idle-extension to get my mails delivered >> immediately. >> >> Unfortunately only one message gets fetched - after that, fetchmail >> recognizes the arrival of a new one, but instead of downloading the >> message, it just triggers another idle. > > Does the attached patch help? > Index: imap.c > =================================================================== > --- imap.c (Revision 4840) > +++ imap.c (Arbeitskopie) > @@ -679,7 +679,7 @@ I'm quite impressed by this quick solution - it works! Well, mostly. Working transfer: --------------------------------------------------------------------- lsr@lsr# /usr/bin/fetchmail -v -v fetchmail: 6.3.4 querying imap.strato.de (protocol IMAP) at Mon 15 May 2006 06:28:17 PM CEST: poll started fetchmail: IMAP< * OK IMAP server ready fetchmail: IMAP> A0001 CAPABILITY fetchmail: IMAP< * CAPABILITY IDLE IMAP4rev1 AUTH=CRAM-MD5 SORT QUOTA NAMESPACE fetchmail: IMAP< A0001 OK CAPABILITY completed fetchmail: Protocol identified as IMAP4 rev 1 fetchmail: will idle after poll fetchmail: IMAP> A0002 AUTHENTICATE CRAM-MD5 fetchmail: IMAP< + PDQ3NzYuMjI1NDUuMTE0NzcxMDQ5NUBwb3N0LndlYm1haWxlci5kZT4= fetchmail: decoded as <477...@po...> fetchmail: IMAP> bHNyQHZpZXctc291cmNlLmRlIDEwZmJjOGY4ZmMzYjJiNDQ3N2I4YjUzYzE1NzYzZmJi fetchmail: IMAP< A0002 OK LOGIN completed fetchmail: selecting or re-polling default folder fetchmail: IMAP> A0003 SELECT "INBOX" fetchmail: IMAP< * 0 EXISTS fetchmail: IMAP< * 0 RECENT fetchmail: IMAP< * FLAGS (\Answered \Flagged \Deleted \Seen \Draft \Forwarded) fetchmail: IMAP< * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \Forwarded)] Permanent flags fetchmail: IMAP< * OK [UIDVALIDITY 1116049368] UIDVALIDITY value fetchmail: IMAP< * OK [UIDNEXT 3273] may be the next UID value fetchmail: IMAP< A0003 OK [READ-WRITE] SELECT completed fetchmail: 0 messages waiting after first poll fetchmail: IMAP> A0004 IDLE fetchmail: IMAP< + will notify you of all changes [sending first mail now...] fetchmail: IMAP< * 1 EXISTS fetchmail: IMAP> DONE fetchmail: IMAP< A0004 OK IDLE completed fetchmail: 1 message waiting after re-poll fetchmail: IMAP> A0005 SEARCH UNSEEN NOT DELETED fetchmail: IMAP< * SEARCH 1 fetchmail: 1 is unseen fetchmail: IMAP< A0005 OK SEARCH completed fetchmail: 1 is first unseen 1 message for ls...@vi... at imap.strato.de. fetchmail: IMAP> A0006 FETCH 1 RFC822.SIZE fetchmail: IMAP< * 1 FETCH (RFC822.SIZE 900) fetchmail: IMAP< A0006 OK Fetch complete fetchmail: IMAP> A0007 FETCH 1 RFC822.HEADER fetchmail: IMAP< * 1 FETCH (RFC822.HEADER {895} reading message ls...@vi...@imap.rzone.de:1 of 1 (895 header octets) About to rewrite From: Lars Tewes <ls...@gm...> Rewritten version is From: Lars Tewes <ls...@gm...> About to rewrite To: Lars Tewes <ls...@vi...> Rewritten version is To: Lars Tewes <ls...@vi...> fetchmail: about to deliver with: /usr/bin/procmail -d 'lsr' # fetchmail: IMAP< ) fetchmail: IMAP< A0007 OK Fetch complete fetchmail: IMAP> A0008 FETCH 1 BODY.PEEK[TEXT] fetchmail: IMAP< * 1 FETCH (BODY[TEXT] {5} (5 body octets) * fetchmail: IMAP< ) fetchmail: IMAP< A0008 OK Fetch complete flushed fetchmail: IMAP> A0009 STORE 1 +FLAGS (\Seen \Deleted) fetchmail: IMAP< * 1 FETCH (FLAGS (\Deleted \Seen \Recent)) fetchmail: IMAP< A0009 OK STORE completed fetchmail: IMAP> A0010 EXPUNGE fetchmail: IMAP< * 1 EXPUNGE fetchmail: IMAP< A0010 OK EXPUNGE completed fetchmail: selecting or re-polling default folder fetchmail: IMAP> A0011 IDLE fetchmail: IMAP< + will notify you of all changes [sending second mail now...] fetchmail: IMAP< * 1 EXISTS fetchmail: IMAP> DONE fetchmail: IMAP< A0011 OK IDLE completed fetchmail: 1 message waiting after re-poll fetchmail: IMAP> A0012 SEARCH UNSEEN NOT DELETED fetchmail: IMAP< * SEARCH 1 fetchmail: 1 is unseen fetchmail: IMAP< A0012 OK SEARCH completed fetchmail: 1 is first unseen 1 message for ls...@vi... at imap.strato.de. fetchmail: IMAP> A0013 FETCH 1 RFC822.SIZE fetchmail: IMAP< * 1 FETCH (RFC822.SIZE 896) fetchmail: IMAP< A0013 OK Fetch complete fetchmail: IMAP> A0014 FETCH 1 RFC822.HEADER fetchmail: IMAP< * 1 FETCH (RFC822.HEADER {896} reading message ls...@vi...@imap.rzone.de:1 of 1 (896 header octets) About to rewrite From: Lars Tewes <ls...@gm...> Rewritten version is From: Lars Tewes <ls...@gm...> About to rewrite To: Lars Tewes <ls...@vi...> Rewritten version is To: Lars Tewes <ls...@vi...> fetchmail: about to deliver with: /usr/bin/procmail -d 'lsr' # fetchmail: IMAP< ) fetchmail: IMAP< A0014 OK Fetch complete fetchmail: IMAP> A0015 FETCH 1 BODY.PEEK[TEXT] fetchmail: IMAP< * 1 FETCH (BODY[TEXT] {0} (0 body octets) fetchmail: IMAP< ) fetchmail: IMAP< A0015 OK Fetch complete flushed fetchmail: IMAP> A0016 STORE 1 +FLAGS (\Seen \Deleted) fetchmail: IMAP< * 1 FETCH (FLAGS (\Deleted \Seen \Recent)) fetchmail: IMAP< A0016 OK STORE completed fetchmail: IMAP> A0017 EXPUNGE fetchmail: IMAP< * 1 EXPUNGE fetchmail: IMAP< A0017 OK EXPUNGE completed fetchmail: selecting or re-polling default folder fetchmail: IMAP> A0018 IDLE fetchmail: IMAP< + will notify you of all changes [works!] --------------------------------------------------------------------- But if I try to not to expunge the messages on the server after the transfer (using "keep" configuration option), fetchmail immediately terminates after fetching the first message. Don't know if this is intended behaviour? --------------------------------------------------------------------- Logfile with "keep" option set: lsr@lsr# /usr/bin/fetchmail -v -v fetchmail: 6.3.4 querying imap.strato.de (protocol IMAP) at Mon 15 May 2006 06:35:00 PM CEST: poll started fetchmail: IMAP< * OK IMAP server ready fetchmail: IMAP> A0001 CAPABILITY fetchmail: IMAP< * CAPABILITY IDLE IMAP4rev1 AUTH=CRAM-MD5 SORT QUOTA NAMESPACE fetchmail: IMAP< A0001 OK CAPABILITY completed fetchmail: Protocol identified as IMAP4 rev 1 fetchmail: will idle after poll fetchmail: IMAP> A0002 AUTHENTICATE CRAM-MD5 fetchmail: IMAP< + PDQ4MDIuMjI1NjkuMTE0NzcxMDg5OUBwb3N0LndlYm1haWxlci5kZT4= fetchmail: decoded as <480...@po...> fetchmail: IMAP> bHNyQHZpZXctc291cmNlLmRlIGQxMGM5ZjMzMDQwNjYxNTRmOTY0OTkxNTk2Nzk3NzJi fetchmail: IMAP< A0002 OK LOGIN completed fetchmail: selecting or re-polling default folder fetchmail: IMAP> A0003 SELECT "INBOX" fetchmail: IMAP< * 0 EXISTS fetchmail: IMAP< * 0 RECENT fetchmail: IMAP< * FLAGS (\Answered \Flagged \Deleted \Seen \Draft \Forwarded) fetchmail: IMAP< * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \Forwarded)] Permanent flags fetchmail: IMAP< * OK [UIDVALIDITY 1116049368] UIDVALIDITY value fetchmail: IMAP< * OK [UIDNEXT 3276] may be the next UID value fetchmail: IMAP< A0003 OK [READ-WRITE] SELECT completed fetchmail: 0 messages waiting after first poll fetchmail: IMAP> A0004 IDLE fetchmail: IMAP< + will notify you of all changes [sending first mail now...] fetchmail: IMAP< * 1 EXISTS fetchmail: IMAP> DONE fetchmail: IMAP< A0004 OK IDLE completed fetchmail: 1 message waiting after re-poll fetchmail: IMAP> A0005 SEARCH UNSEEN NOT DELETED fetchmail: IMAP< * SEARCH 1 fetchmail: 1 is unseen fetchmail: IMAP< A0005 OK SEARCH completed fetchmail: 1 is first unseen 1 message for ls...@vi... at imap.strato.de. fetchmail: IMAP> A0006 FETCH 1 RFC822.SIZE fetchmail: IMAP< * 1 FETCH (RFC822.SIZE 709) fetchmail: IMAP< A0006 OK Fetch complete fetchmail: IMAP> A0007 FETCH 1 RFC822.HEADER fetchmail: IMAP< * 1 FETCH (RFC822.HEADER {704} reading message ls...@vi...@imap.rzone.de:1 of 1 (704 header octets) About to rewrite From: Lars Tewes <ls...@gm...> Rewritten version is From: Lars Tewes <ls...@gm...> About to rewrite To: Lars Tewes <ls...@vi...> Rewritten version is To: Lars Tewes <ls...@vi...> fetchmail: about to deliver with: /usr/bin/procmail -d 'lsr' # fetchmail: IMAP< ) fetchmail: IMAP< A0007 OK Fetch complete fetchmail: IMAP> A0008 FETCH 1 BODY.PEEK[TEXT] fetchmail: IMAP< * 1 FETCH (BODY[TEXT] {5} (5 body octets) * fetchmail: IMAP< ) fetchmail: IMAP< A0008 OK Fetch complete not flushed fetchmail: IMAP> A0009 STORE 1 +FLAGS (\Seen) fetchmail: IMAP< * 1 FETCH (FLAGS (\Seen \Recent)) fetchmail: IMAP< A0009 OK STORE completed fetchmail: IMAP> A0010 LOGOUT fetchmail: IMAP< * BYE fetchmail: IMAP< A0010 OK LOGOUT completed fetchmail: 6.3.4 querying imap.strato.de (protocol IMAP) at Mon 15 May 2006 06:35:28 PM CEST: poll completed fetchmail: not swapping UID lists, no UIDs seen this query fetchmail: Writing fetchids file. fetchmail: normal termination, status 0 fetchmail: Writing fetchids file. --------------------------------------------------------------------- Thanks a lot for the patch! Best, Lars |