One thing I *always* do before mucking with some user's mail spool is
to lock the spool with a

'touch /var/mail/<user>.lock;chmod 0 /var/mail/<user>.lock"
or 
"touch /var/spool/mail/<user>.lock; chmod 0 /var/spool/mail/<user>.lock"

Is this a *true* lock?  Well, there are no semaphores set, but for
programs that check for the existence of the file (sendmail, popper,
and imapd) it performs the same function.

On all the systems (SVR4 and above) that I've mucked with this seems to
stop sendmail in it's tracks, stops Eudora users and popper, as well as
mailx, openwin/bin/mailtool and /usr/dt/bin/dtmail...  I imagine that
it would also stop MS Outlook since it relies on popper...

Be advised, however, that after you set the lock file, you have about 6
minutes to clear it or it gets cleared automatically.

Just my $0.02 worth...

Regards,
Gregory Hicks

> Date: Wed, 30 May 2001 11:14:37 -1000
> From: Clifton Royston <[EMAIL PROTECTED]>
> 
> On Wed, May 30, 2001 at 09:09:36AM -1000, Clifton Royston wrote:
> > In *theory* and in the worst case, I think that in server mode lost
> > mail could result in some combination of circumstances, like a user
> > reading mail with a carelessly implemented shell mail client, plus
> > using POP at the same time, plus mail arrives during the POP session. 
> 
>   Ugh.
> 
>   I just got confirmation of this; it's no theory.  One of our tech
> support people was using sudo + pine to try to fix a user's spool file,
> to try to help them get rid of a bad attachment they couldn't download,
> the user POPped their mail, new mail came in, pine resynced, and *pow*
> they ended up with no spool file and a corrupted temporary file.  We'll
> have to lay out some new procedures for support to use to avoid this; I
> just hadn't thought of this situation.
> 
>   I hate pine.
> 
>   -- Clifton
> 
> -- 
>  Clifton Royston  --  LavaNet Systems Architect --  [EMAIL PROTECTED]
>    WWJD?   "JWRTFM!" - Scott Dorsey (kludge)   "JWG" - Eddie Aikau

---------------------------------------------------------------------
Gregory Hicks                           | Principal Systems Engineer
Cadence Design Systems                  | Direct:   408.576.3609
555 River Oaks Pkwy M/S 6B1             | Fax:      408.894.3479
San Jose, CA 95134                      | Internet: [EMAIL PROTECTED]

Reply via email to