[tpop3d-discuss]Outlook duplicate messages

Dragos Nitu dragos.nitu at idilis.net
Sat, 22 May 2004 03:56:12 +0200


I had the same problem with Microsoft Outlook. I didn't try the other patch, 
it seemed broken :). However I needed a quick hack before the problem is
solved, so I made this patch which transforms the QUIT command in timeout (10
seconds), so tpop3 can process other commands.

The problem is that if after quit, if there are other commands, the connection
stays open at least timeout-seconds (default 30). However, Outlook seems to
close the connection itself, so it works OK (with a warning from tpop3d).

Normal clients, which send the QUIT command last, have to wait 10 seconds
before the connection is actually closed. If they close the connection, tpop3d
gives a warning, but it doesn't crashes anymore.

I know that this doesn't *really* solves the problem, but maybe it can help
somebody.

--- tpop3d/netloop.c.orig       Tue Feb  3 21:52:03 2004
+++ tpop3d/netloop.c    Sat May 22 03:11:50 2004
@@ -421,6 +421,13 @@
                 enum connection_action act;

                 act = connection_do(c, p);
+               if(p->cmd == QUIT)
+               {
+                   c->idlesince = time(NULL) -  timeout_seconds + 10;
+                   pop3command_delete(p);
+                }
+               else
+               {
                 pop3command_delete(p);
                 switch (act) {
                     case close_connection:
@@ -446,6 +453,7 @@

                 if (!c || c->do_shutdown)
                     break;
+               }
             }


You can also find the patch here:
http://ftp.idilis.ro/linux/idilis/tpop3d-1.5.3-outlook.patch

Dragos Nitu
Idilis S.A.
Tel: +40-21-2082800
Fax: +40-21-2082801