10 messages in net.sourceforge.lists.courier-users[courier-users] Patch for expunge aft...
FromSent OnAttachments
Steinar HamreOct 11, 2001 4:12 am.diff
Oliver BlasnikOct 11, 2001 5:53 am 
Mogens ValentinOct 12, 2001 1:08 pm 
Oliver BlasnikOct 13, 2001 4:14 pm 
Steinar HamreOct 13, 2001 5:15 pm.before, .after, .Other, 1 more
Laurence MooreOct 13, 2001 6:01 pm 
Steinar HamreOct 13, 2001 8:19 pm 
Laurence MooreOct 13, 2001 9:56 pm 
James KnightOct 14, 2001 10:01 am 
Laurence MooreOct 14, 2001 3:29 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[courier-users] Patch for expunge after drag'n'drop in OutLook ExpressActions...
From:Steinar Hamre (stei@pvv.ntnu.no)
Date:Oct 11, 2001 4:12:50 am
List:net.sourceforge.lists.courier-users
Attachments:

Hi, When moving messages by drag'n'drop in OE. The stupid, stupid client makes another connection to the imap server for this operation. If the user then tries to expunge using the menu, the main connection sends the EXPUNGE, but the imapserver serving the main connection do not know about any \Deleted messages, therefore nothing is expunged. (A second expunge works because noop() rescans the mailboks, and noop() is called after expunge().)

The attaced patch fixes this, by calling a quiet version of noop() before expunge() if IMAP_CLIENT_BUGS is true. The patch is relative to courier-imap-1.3.11.

This is the right place for submitting patches to courier imapd?

Steinar

--- courier-imap-1.3.11/imap/imapd.c.orig Fri Sep 28 18:42:56 2001 +++ courier-imap-1.3.11/imap/imapd.c Wed Oct 10 17:20:07 2001 @@ -902,8 +902,20 @@

/****************************************************************************/

+static void donoop(int writestats); + static void noop() { + donoop(1); +} + +static void quietnoop() +{ + donoop(0); +} + +static void donoop(int writestats) +{ struct imapscaninfo new_mailbox_info; unsigned long i, j; int needstats=0; @@ -931,9 +943,11 @@ new_mailbox_info.msgs[j].uid > current_mailbox_info.msgs[i].uid) { - writes("* "); - writen(i+1-expunged); - writes(" EXPUNGE\r\n"); + if (writestats) { + writes("* "); + writen(i+1-expunged); + writes(" EXPUNGE\r\n"); + } needstats=1; ++expunged; continue; @@ -962,7 +976,7 @@ imapscan_free(&current_mailbox_info); current_mailbox_info=new_mailbox_info;

- if (needstats) + if (needstats && writestats) mailboxmetrics();

#if IMAP_CLIENT_BUGS @@ -2548,6 +2562,13 @@ if (strcmp(curtoken->tokenbuf, "EXPUNGE") == 0) { if (nexttoken()->tokentype != IT_EOL) return (-1); +#if IMAP_CLIENT_BUGS + /* OE logges in with a new connection when moving + messages by drag'n'drop. This is needed to make + the first expunge thereafter work. */ + + quietnoop(); +#endif expunge(); noop(); writes(tag);