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(¤t_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);