From: Brendan L. <bre...@ai...> - 2006-03-13 20:03:24
|
That seem to be intentional first-pass behaviour (i.e. not really the general Idle polling case). Look at these lines from imap_getrange(): 732 * We should have an expunge here to 733 * a) avoid fetching deleted mails during 'fetchall' 734 * b) getting a wrong count of mails during 'no fetchall' 735 */ 736 if (!check_only && !ctl->keep && count > 0) 737 { 738 ok = internal_expunge(sock); 739 if (ok) This generates the EXPUNGE you see. However this only happens for the first message, since this is the "else" case of the if statement: 672 if (pass > 1) 673 { 674 /* deleted mails have already been expunged by 675 * end_mailbox_poll(). and will only be taken before the first message has been seen. After the first message has been seen no EXPUNGE is sent (and the comment suggests why the code does not do an EXPUNGE in this case). A trace shows exactly this behaviour: First time: 18:00:55 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 018:00:55 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={28, 0}}, NULL) = 0 18:00:55 recv(4, 0xbfea66fb, 8192, MSG_PEEK) = ? ERESTARTSYS (To be restarted) 18:01:23 --- SIGALRM (Alarm clock) @ 0 (0) --- 18:01:23 sigreturn() = ? (mask now []) 18:01:23 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 018:01:23 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0 18:01:23 write(4, "A0013 NOOP\r\n", 12) = 12 18:01:23 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={300, 0}}, NULL) = 0 18:01:23 recv(4, "A0013 OK NOOP completed\r\n", 8192, MSG_PEEK) = 25 18:01:23 read(4, "A0013 OK NOOP completed\r\n", 25) = 25 18:01:23 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 018:01:23 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={28, 0}}, NULL) = 0 18:01:23 recv(4, "* 1 EXISTS\r\n", 8192, MSG_PEEK) = 12 18:01:47 read(4, "* 1 EXISTS\r\n", 12) = 12 18:01:47 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 018:01:47 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0 18:01:47 write(4, "A0014 EXPUNGE\r\n", 15) = 15 18:01:47 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={300, 0}}, NULL) = 0 18:01:47 recv(4, "* 1 RECENT\r\nA0014 OK EXPUNGE completed\r\n", 8192, MSG_PEEK) = 40 18:01:47 read(4, "* 1 RECENT\r\n", 12) = 12 18:01:47 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 018:01:47 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={300, 0}}, NULL) = 0 18:01:47 recv(4, "A0014 OK EXPUNGE completed\r\n", 8192, MSG_PEEK) = 28 18:01:47 read(4, "A0014 OK EXPUNGE completed\r\n", 28) = 2818:01:47 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0 18:01:47 write(4, "A0015 FETCH 1 RFC822.SIZE\r\n", 27) = 27 18:01:47 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={300, 0}}, NULL) = 0 18:01:47 recv(4, "* 1 FETCH (RFC822.SIZE 7640)\r\n", 8192, MSG_PEEK) = 30 Later times: 18:03:12 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={28, 0}}, NULL) = 0 18:03:12 recv(4, 0xbfea66fb, 8192, MSG_PEEK) = ? ERESTARTSYS (To be restarted) 18:03:40 --- SIGALRM (Alarm clock) @ 0 (0) --- 18:03:40 sigreturn() = ? (mask now []) 18:03:40 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 018:03:40 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0 18:03:40 write(4, "A0024 NOOP\r\n", 12) = 12 18:03:40 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={300, 0}}, NULL) = 0 18:03:40 recv(4, "A0024 OK NOOP completed\r\n", 8192, MSG_PEEK) = 25 18:03:40 read(4, "A0024 OK NOOP completed\r\n", 25) = 25 18:03:40 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 018:03:40 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={28, 0}}, NULL) = 0 18:03:40 recv(4, "* 1 EXISTS\r\n", 8192, MSG_PEEK) = 12 18:03:49 read(4, "* 1 EXISTS\r\n", 12) = 12 18:03:49 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 018:03:49 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 018:03:49 write(4, "A0025 NOOP\r\n", 12) = 12 18:03:49 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={300, 0}}, NULL) = 0 18:03:49 recv(4, "* 1 RECENT\r\nA0025 OK NOOP completed\r\n", 8192, MSG_PEEK) = 37 18:03:49 read(4, "* 1 RECENT\r\n", 12) = 12 18:03:49 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 018:03:49 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={300, 0}}, NULL) = 0 18:03:49 recv(4, "A0025 OK NOOP completed\r\n", 8192, MSG_PEEK) = 25 18:03:49 read(4, "A0025 OK NOOP completed\r\n", 25) = 25 18:03:49 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 018:03:49 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 018:03:49 write(4, "A0026 FETCH 1 RFC822.SIZE\r\n", 27) = 27 After the first RECEIVE further RECEIVES are followed by a FETCH without intervening EXPUNGE. Brendan mat...@gm... wrote: >I've committed the patch. One thing makes me wonder though: > >fetchmail: IMAP> A0004 NOOP >fetchmail: IMAP< A0004 OK NOOP completed. >fetchmail: IMAP> A0005 NOOP >fetchmail: IMAP< * 1 EXISTS >fetchmail: IMAP< * 1 RECENT >fetchmail: IMAP< A0005 OK NOOP completed. >fetchmail: IMAP> A0006 EXPUNGE >fetchmail: IMAP< A0006 OK Expunge completed. > >Why does fetchmail perform an EXPUNGE after NOOP? >Accident or intent? > > > |