Binary files qpopper4.0.5-installed/popper/.pop_config.c.swp and qpopper4.0.5/popper/.pop_config.c.swp differ
Binary files qpopper4.0.5-installed/popper/.pop_dropcopy.c.swp and qpopper4.0.5/popper/.pop_dropcopy.c.swp differ
diff -urbN qpopper4.0.5-installed/popper/pop_config.c qpopper4.0.5/popper/pop_config.c
--- qpopper4.0.5-installed/popper/pop_config.c	Tue Jan 27 18:49:24 2004
+++ qpopper4.0.5/popper/pop_config.c	Tue Jan 27 21:24:43 2004
@@ -236,6 +236,7 @@
     kHM_FREE,		    /* -h base+secs:bytes@FREE/max */
     kHM_MAX,		    /* -h base+secs:bytes@free/MAX */
     kHM_BUFSIZ,		    /* -z bufsiz        */
+    kHM_SLEEP,              /*    (no flag)     */
 #endif /* HAPPYMAIL */
     kPOPPER_HOST,           /*    (no flag)     */
     kPOPPER_NAME,           /*    (no flag)     */
@@ -278,12 +279,13 @@
     { "group-no-server-mode"         , CfgStr  , CfgResUser, kGRP_NO_SERV_MODE   },
     { "group-server-mode"            , CfgStr  , CfgResUser, kGRP_SERV_MODE      },
 #ifdef HAPPYMAIL
-    { "happymail-base"               , CfgIntTime , CfgResInit, kHM_BASE         },
-    { "happymail-rate-seconds"       , CfgIntTime , CfgResInit, kHM_RATE_S       },
-    { "happymail-rate-bytes"         , CfgIntSpace , CfgResInit, kHM_RATE_B      },
-    { "happymail-free"               , CfgIntSpace , CfgResInit, kHM_FREE        },
-    { "happymail-max"                , CfgIntTime , CfgResInit, kHM_MAX          },
-    { "happymail-bufsiz"             , CfgIntSpace , CfgResInit, kHM_BUFSIZ      },
+    { "happymail-base"               , CfgIntTime  , CfgResNone, kHM_BASE        },
+    { "happymail-rate-seconds"       , CfgIntTime  , CfgResNone, kHM_RATE_S      },
+    { "happymail-rate-bytes"         , CfgIntSpace , CfgResNone, kHM_RATE_B      },
+    { "happymail-free"               , CfgIntSpace , CfgResNone, kHM_FREE        },
+    { "happymail-max"                , CfgIntTime  , CfgResNone, kHM_MAX         },
+    { "happymail-bufsiz"             , CfgIntSpace , CfgResNone, kHM_BUFSIZ      },
+    { "happymail-sleep"              , CfgIntTime  , CfgResNone, kHM_SLEEP       },
 #endif /* HAPPYMAIL */
     { "hash-spool"                   , CfgInt  , CfgResUser, kHASH_SPOOL         },
     { "home-dir-mail"                , CfgStr  , CfgResUser, kHOME_DIR_MAIL      },
@@ -954,6 +956,7 @@
 	case kHM_FREE:             R__INT ( &p->happymail_free );
 	case kHM_MAX:              R__INT ( &p->happymail_max );
 	case kHM_BUFSIZ:           R__INT ( &p->happymail_bufsiz );
+	case kHM_SLEEP:            R__INT ( &p->happymail_sleep );
 #endif /* HAPPYMAIL */
 #ifdef LOCALNAMES
         case kPOPPER_HOST:         R__PTR ( &p->pPopper_Host );
diff -urbN qpopper4.0.5-installed/popper/pop_dropcopy.c qpopper4.0.5/popper/pop_dropcopy.c
--- qpopper4.0.5-installed/popper/pop_dropcopy.c	Tue Jan 27 18:36:59 2004
+++ qpopper4.0.5/popper/pop_dropcopy.c	Tue Jan 27 21:16:30 2004
@@ -1236,19 +1236,49 @@
 	}
 
 	mydelay = (p->happymail_base + adjust);
-	mydelay -= mydelay % 60;	/* should be a round # of minutes */
-
 
 	/* don't allow mydelay to be larger than max */
 	if (p->happymail_max > 0 && mydelay > p->happymail_max)
 	    mydelay = p->happymail_max;
 
-	if (my_timer - p->happymail_tab[pwp->pw_uid] < mydelay - 30) {
+	if (my_timer - p->happymail_tab[pwp->pw_uid] < mydelay) {
+            if (mydelay <= p->happymail_sleep ) {
+                pop_log ( p, POP_NOTICE, HERE,
+#ifdef DEBUG
+			    "%s at localhost: "
+#else
+			    "%s at %s (%s): "
+#endif /* DEBUG */			    
+			    "[HAPPYMAIL] Sleeping for %d %s "
+			    "[%d+%d:%d@%d!%d (%d) => %d + %d %s %d]",
+			    p->user ? p->user : "(null)",
+#ifndef DEBUG
+			    p->client, 
+			    p->ipaddr,
+#endif /* DEBUG */ 
+			    (mydelay % 60) ? mydelay : mydelay/60,
+			    (mydelay % 60) ? "second(s)" : "minute(s)", 
+			    p->happymail_base,
+			    p->happymail_rate_s,
+			    p->happymail_rate_b,
+			    p->happymail_free,
+			    p->happymail_max,
+			    mybuf.st_size,
+			    p->happymail_base,
+			    adjust,
+			    p->happymail_base + adjust > p->happymail_max ?
+				">" : "=>",
+			    mydelay
+			);		
+                sleep ( mydelay );
+            }
+            else
 	    return (pop_msg(p, POP_FAILURE, HERE,
-			    "[HAPPYMAIL] Please wait at least %d minutes "
-			    "between checks. "
+			    "[HAPPYMAIL] Please wait at least %d %s "
+			    "between checking your email. "
 			    "[%d+%d:%d@%d!%d (%d) => %d + %d %s %d] ",
-			    mydelay/60,
+			    (mydelay % 60) ? mydelay : mydelay/60,
+			    (mydelay % 60) ? "second(s)" : "minute(s)", 
 			    p->happymail_base,
 			    p->happymail_rate_s,
 			    p->happymail_rate_b,
diff -urbN qpopper4.0.5-installed/popper/pop_init.c qpopper4.0.5/popper/pop_init.c
--- qpopper4.0.5-installed/popper/pop_init.c	Tue Jan 27 18:49:19 2004
+++ qpopper4.0.5/popper/pop_init.c	Tue Jan 27 19:59:00 2004
@@ -766,6 +766,8 @@
     p->happymail_max = 0;		/* no maximum */
     /* bulk copy blocksize */
     p->happymail_bufsiz = 0;		/* use the default, don't setvbuf() */
+    /* sleep instead of error if mydelay < happymail_sleep */
+    p->happymail_sleep = 0;
 #endif /* HAPPYMAIL */
 
 
diff -urbN qpopper4.0.5-installed/popper/popper.h qpopper4.0.5/popper/popper.h
--- qpopper4.0.5-installed/popper/popper.h	Tue Jan 27 18:49:24 2004
+++ qpopper4.0.5/popper/popper.h	Tue Jan 27 19:54:19 2004
@@ -102,7 +102,7 @@
 #define OUT_BUF_SIZE    512 /* Amount of output to buffer before forcing a write */
 
 #ifdef HAPPYMAIL
-# define HAPPYMAIL_PATCHLEVEL "pl8"
+# define HAPPYMAIL_PATCHLEVEL "pl8-jm-pl1"
 #endif /* HAPPYMAIL */
 
 #ifndef MAXHOSTNAMELEN
@@ -664,6 +664,7 @@
     int			happymail_max;		/* upper boundary on timer */
     time_t          *   happymail_tab;          /* per-uid shmem check table */
     int                 happymail_bufsiz;	/* buffer size for maildrops */
+    int                 happymail_sleep;        /* less than this sleep instead of error */
 #endif /* HAPPYMAIL */
 
     BOOL                bUser_opts;             /* Process ~/.qpopper-options */
