Path: utzoo!utgpu!watmath!maytag!accwai From: accwai@maytag.waterloo.edu (Andy Wai) Newsgroups: uw.unix Subject: Re: no mail directory Keywords: mail Message-ID: <484@maytag.waterloo.edu> Date: 15 Sep 89 15:15:30 GMT References: <16338@watdragon.waterloo.edu> <29083@watmath.waterloo.edu> <16416@watdragon.waterloo.edu> Reply-To: accwai@maytag.waterloo.edu (Andy Wai) Distribution: uw Organization: Math Faculty Computing Facility, University of Waterloo Lines: 37 In article <16416@watdragon.waterloo.edu> dgcasperson@violet.waterloo.edu (david Casperson) writes: > >One problem with this is that emacs rmail and perhaps other programs >don't know that they are supposed to leave the spool file empty, so >they go ahead and kill the spool file. [...] That's not entirely true. The following is the code in etc/movemail.c that closes the inbox: #ifdef MAIL_USE_FLOCK #if defined(STRIDE) || defined(XENIX) /* Stride, xenix have file locking, but no ftruncate. This mess will do. */ (void) close (open (inname, O_CREAT | O_TRUNC | O_RDWR, 0666)); #else (void) ftruncate (indesc, 0L); #endif /* STRIDE or XENIX */ #endif /* MAIL_USE_FLOCK */ close (indesc); #ifndef MAIL_USE_FLOCK /* Delete the input file; if we can't, at least get rid of its contents. */ if (unlink (inname) < 0) if (errno != ENOENT) creat (inname, 0666); (void) unlink (lockname); #endif /* not MAIL_USE_FLOCK */ If MAIL_USE_FLOCK is defined, then the file "inname" will get truncated. In our case, the local sendmail doesn't use flock(). So, MAIL_USE_FLOCK is not defined and "inname" got deleted. I've been wondering about this, but the choice seem quite deliberate. That's why I never bother to change the behavior. I use rmail and from myself, and I realize how much of a hassle it is. But you can aways get from to shut up by redirecting stderr to /dev/null. Andy