Here's the quick & dirty patch.  Of course, the delay should be a run-time
config setting, possibly dependent on the client address, etc.

--- popper.c    2003/03/13 17:05:02     1.1
+++ popper.c    2003/03/13 17:08:47
@@ -311,6 +311,21 @@
             }
         } 
         else { /* start new command */
+           /*
+            * If M$ Outlook XP receives a response "faster than it expects",
+            * it ignores the data, and hangs.  Work around it.
+            */
+           int command_delay = 50;     /* should be in config; too lazy */
+           if (command_delay) {
+#ifdef    HAVE_USLEEP
+                   usleep(command_delay*1000); /* ms -> usec */
+#else
+                   struct timeval tv;
+                   tv.tv_sec = 0;
+                   tv.tv_usec = command_delay*1000;
+                   select(0, NULL, NULL, NULL, &tv);
+#endif
+           }
             s = pop_get_command ( &p, message );
             if ( s != NULL )  {
                 if ( s->function != NULL ) {

Reply via email to