[Dovecot] thunderbird pop3 delete bug workaround

Jens Laas jens.laas at data.slu.se
Wed Aug 24 15:01:48 EEST 2005


Following is patch that allows tbird to download and redelete the last 
deleted message.

Not particularily nice but for "normal" usage the bug/workaround is not 
triggered.

Tested with huge inbox.

--- src/pop3/client.h.orig	2005-08-23 15:00:48.000000000 +0200
+++ src/pop3/client.h	2005-08-23 15:02:18.000000000 +0200
@@ -35,6 +35,9 @@
  	unsigned int top_count;
  	unsigned int retr_count;

+        unsigned int last_deleted;
+        int tbirdbug;
+
  	uoff_t *byte_counter;
  	uoff_t byte_counter_offset;

--- src/pop3/commands.c.orig	2005-08-24 13:24:33.000000000 +0200
+++ src/pop3/commands.c	2005-08-24 13:26:49.000000000 +0200
@@ -47,8 +47,15 @@
  	if (client->deleted) {
  		if (client->deleted_bitmask[num / CHAR_BIT] &
  		    (1 << (num % CHAR_BIT))) {
-			client_send_line(client, "-ERR Message is deleted.");
-			return NULL;
+		        if((client->tbirdbug<256) && (num == client->last_deleted))
+			  {
+			    client->tbirdbug++;
+			  }
+			else
+			  {
+			    client_send_line(client, "-ERR Message is deleted.");
+			    return NULL;
+			  }
  		}
  	}

@@ -109,6 +116,7 @@
  	client->deleted_count++;
  	client->deleted_size += client->message_sizes[msgnum];
  	client_send_line(client, "+OK Marked to be deleted.");
+	client->last_deleted = msgnum;
  	return TRUE;
  }


-----------------------------------------------------------------------
     'This mail automatically becomes portable when carried.'
-----------------------------------------------------------------------
     Jens Låås                              Email: jens.laas at data.slu.se
     Department of Computer Services, SLU   Phone: +46 18 67 35 15
     Vindbrovägen 1
     P.O. Box 7079
     S-750 07 Uppsala
     SWEDEN
-----------------------------------------------------------------------


More information about the dovecot mailing list