diff -ruN imap-4.6.BETA.orig/Makefile imap-4.6.BETA/Makefile --- imap-4.6.BETA.orig/Makefile Wed Apr 21 10:42:32 1999 +++ imap-4.6.BETA/Makefile Sat May 1 21:22:24 1999 @@ -161,7 +161,7 @@ # gradually-increasing intervals, starting at 2800-2900, and becoming # permanent at 48,300. -EXTRACFLAGS= +EXTRACFLAGS=-DVERBOSELOG # Extra linker flags (additional/alternative libraries, etc.) diff -ruN imap-4.6.BETA.orig/src/imapd/imapd.c imap-4.6.BETA/src/imapd/imapd.c --- imap-4.6.BETA.orig/src/imapd/imapd.c Fri Mar 26 09:11:29 1999 +++ imap-4.6.BETA/src/imapd/imapd.c Sat May 1 21:37:52 1999 @@ -58,6 +58,11 @@ #include #include "misc.h" +#ifdef VERBOSELOG +#include +#include +#include +#endif /* Timeouts and timers */ @@ -209,6 +214,11 @@ char *lastid = NIL; /* last fetched body id for this message */ SIZEDTEXT lastst = {NIL,0}; /* last sizedtext */ +#ifdef VERBOSELOG +time_t *timer; /* timer */ +time_t starttime; /* record start time of process */ +double uutime,sstime; /* user and system time */ +#endif /* Response texts which appear in multiple places */ @@ -235,6 +245,9 @@ int main (int argc,char *argv[]) { +#ifdef VERBOSELOG + struct rusage sysinfo; +#endif unsigned long i,j,k,m,uid; long f; char *s,*t,*u,*v,tmp[MAILTMPLEN]; @@ -264,6 +277,9 @@ default: fatal ("Unknown state from myusername_full()"); } +#ifdef VERBOSELOG + starttime = time(timer); +#endif PSOUT ("* "); PSOUT (t); PBOUT (' '); @@ -1114,6 +1130,34 @@ } while (state != LOGOUT); /* until logged out */ syslog (LOG_INFO,"Logout user=%.80s host=%.80s",user ? user : "???", tcp_clienthost ()); +#ifdef VERBOSELOG + /* This is for additional logging information so that we can do analysis */ + getrusage(RUSAGE_SELF,&sysinfo); + + uutime = (double) sysinfo.ru_utime.tv_sec + + sysinfo.ru_utime.tv_usec / 1000000.0; + sstime = (double) sysinfo.ru_stime.tv_sec + + sysinfo.ru_stime.tv_usec / 1000000.0; + + syslog (LOG_INFO,"u %s from %s start %d et %d ut %.3f st %.3f mss %ld iss %ld minf %ld majf %ld sw %ld bi %ld bo %ld mi %ld mo %ld nsig %ld vcs %ld ics %ld", user ? user : "???", + tcp_clienthost (), + starttime, + time(timer) - starttime, + uutime, + sstime, + sysinfo.ru_maxrss, + sysinfo.ru_idrss, + sysinfo.ru_minflt, + sysinfo.ru_majflt, + sysinfo.ru_nswap, + sysinfo.ru_inblock, + sysinfo.ru_oublock, + sysinfo.ru_msgrcv, + sysinfo.ru_msgsnd, + sysinfo.ru_nsignals, + sysinfo.ru_nvcsw, + sysinfo.ru_nivcsw); +#endif return 0; /* all done */ } @@ -1339,12 +1383,43 @@ void clkint (void) { +#ifdef VERBOSELOG + struct rusage sysinfo; +#endif alarm (0); /* disable all interrupts */ server_init (NIL,NIL,NIL,NIL,SIG_IGN,SIG_IGN,SIG_IGN,SIG_IGN); if (!quell_events) PSOUT ("* BYE Autologout; idle for too long\015\012"); syslog (LOG_INFO,"Autologout user=%.80s host=%.80s",user ? user : "???", tcp_clienthost ()); +#ifdef VERBOSELOG + /* This is for additional logging information so that we can do analysis */ + getrusage(RUSAGE_SELF,&sysinfo); + + uutime = (double) sysinfo.ru_utime.tv_sec + + sysinfo.ru_utime.tv_usec / 1000000.0; + sstime = (double) sysinfo.ru_stime.tv_sec + + sysinfo.ru_stime.tv_usec / 1000000.0; + + syslog (LOG_INFO,"u %s from %s start %d et %d ut %.3f st %.3f mss %ld iss %ld minf %ld majf %ld sw %ld bi %ld bo %ld mi %ld mo %ld nsig %ld vcs %ld ics %ld", user ? user : "???", + tcp_clienthost (), + starttime, + time(timer) - starttime, + uutime, + sstime, + sysinfo.ru_maxrss, + sysinfo.ru_idrss, + sysinfo.ru_minflt, + sysinfo.ru_majflt, + sysinfo.ru_nswap, + sysinfo.ru_inblock, + sysinfo.ru_oublock, + sysinfo.ru_msgrcv, + sysinfo.ru_msgsnd, + sysinfo.ru_nsignals, + sysinfo.ru_nvcsw, + sysinfo.ru_nivcsw); +#endif PFLUSH; /* make sure output blatted */ if (critical) state = LOGOUT; /* badly hosed if in critical code */ else { /* try to gracefully close the stream */ diff -ruN imap-4.6.BETA.orig/src/osdep/unix/Makefile imap-4.6.BETA/src/osdep/unix/Makefile --- imap-4.6.BETA.orig/src/osdep/unix/Makefile Mon Mar 15 19:56:46 1999 +++ imap-4.6.BETA/src/osdep/unix/Makefile Sun May 2 00:41:10 1999 @@ -75,8 +75,8 @@ # set certain other formats (e.g. mbx and mx) as the EMPTYPROTO since these # formats can never be empty files. -CREATEPROTO=unixproto -EMPTYPROTO=unixproto +CREATEPROTO=mbxproto +EMPTYPROTO=mbxproto # Commands possibly overriden by the individual port diff -ruN imap-4.6.BETA.orig/src/osdep/unix/dummy.c imap-4.6.BETA/src/osdep/unix/dummy.c --- imap-4.6.BETA.orig/src/osdep/unix/dummy.c Fri Nov 13 17:40:33 1998 +++ imap-4.6.BETA/src/osdep/unix/dummy.c Sat May 1 21:56:32 1999 @@ -261,11 +261,9 @@ /* list it if not at top-level */ if (!level && dir && pmatch_full (dir,pat,'/')) dummy_listed (stream,'/',dir,LATT_NOSELECT,contents); - /* scan directory, ignore . and .. */ + /* scan directory, ignore . files */ if (!dir || dir[strlen (dir) - 1] == '/') while (d = readdir (dp)) - if ((d->d_name[0] != '.') || - (d->d_name[1] && (((d->d_name[1] != '.') || d->d_name[2]) && - strcmp (d->d_name+1,MXINDEXNAME+3)))) { + if (d->d_name[0] != '.') { /* see if name is useful */ if (dir) sprintf (tmp,"%s%s",dir,d->d_name); else strcpy (tmp,d->d_name); diff -ruN imap-4.6.BETA.orig/src/osdep/unix/env_unix.c imap-4.6.BETA/src/osdep/unix/env_unix.c --- imap-4.6.BETA.orig/src/osdep/unix/env_unix.c Wed Apr 21 17:38:54 1999 +++ imap-4.6.BETA/src/osdep/unix/env_unix.c Sun May 2 00:39:42 1999 @@ -514,7 +514,8 @@ nslist[0] = &nshome,nslist[1] = &nsblackother,nslist[2] = &nsshared; else { /* not a black box */ nslist[0] = &nshome,nslist[1] = &nsunixother,nslist[2] = &nsshared; - myHomeDir = cpystr (home);/* use real home directory */ + sprintf (tmp,"/var/imap/%s",myUserName); /* DON'T use real home dir */ + myHomeDir = cpystr (tmp); /* use /var/imap/ */ /* make sure user rc files don't try this */ blackBoxDir = blackBoxDefaultHome = ""; }