Subject: Auto-logout while IDLE?

From: "Erik R. Leo" <[email-masked]>
Date: Mon, 8 Mar 1999 13:32:13 -0500 (EST)

Hi;

	We're running imapd (IMAP4rev1 v12.250) on a fairly busy server.
We noticed certain users were leaving a lot of imapd processes (over 100
for one of our more pathological cases) around for a much longer than the
default 30 minute auto-logout time (days or even weeks, depending on when
someone would notice & get in to clean things up).

	We believe the problem is that the user's client has issued an
IDLE command, which leaves imapd in tight loop with no alarm set.  We also
see that RFC 2177 permits an auto-logout in the IDLE state.

	Our question is whether anyone forsees a problem with making the
change (either the concept or the implementation, in the patch below)?

Thanks,
-Erik
-- 
Erik R. Leo, Net Worker       SoVerNet
Tel:    +1(802)463-2111       Vermont's Sovereign Internet Connection
Fax:    +1(802)463-2110       Post Office Box 495, 5 Rockingham Street
Email:  [email-masked]       Bellows Falls, Vermont 05101

*** imapd.c	Mon Mar  8 13:19:38 1999
--- imapd.c.orig	Mon Mar  8 13:14:57 1999
***************
*** 1039,1045 ****
  				/* remember last checkpoint */
  	      lastcheck = time (0);
  	    }
- 	    alarm(TIMEOUT);
  	    do {		/* main idle loop */
  	      mail_parameters (stream,SET_ONETIMEEXPUNGEATPING,(void *)stream);
  	      ping_mailbox (uid);
--- 1039,1044 ----
***************
*** 1051,1057 ****
  	      }
  	      PFLUSH;		/* dump output buffer */
  	    } while ((state != LOGOUT) && !server_input_wait (IDLETIMEOUT));
- 	    alarm(0);
  	    if (state != LOGOUT) {
  	      slurp (tmp,MAILTMPLEN);
  	      if (((tmp[0] != 'D') && (tmp[0] != 'd')) ||
--- 1050,1055 ----

-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mark Crispin <[email-masked]>
Date: Mon, 8 Mar 1999 21:43:36 -0800 (PST)

> someone would notice & get in to clean things up).

Thank you for reporting this problem.  It is fixed in 12.251.  Your
suggested patch will work; however, I have chosen to address the problem
in a somewhat different manner to prevent a theoretical race.  In
addition, 12.251 has a patch to prevent an unlogged in imapd from being
kept alive by sending it frequent NOOPs.

12.251 is available in the current:
	ftp://ftp.cac.washington.edu/mail/imap-4.6.BETA.tar.Z