procmail
[Top] [All Lists]

Re: Need to deliver mail to 2 different spool areas

1997-02-12 14:00:54
Pam Skillman <pamela(_at_)infi(_dot_)net> writes:
I would like to spool mail to 2 different directories in order to
keep a backup of spooled mail to disk until the next tape backup 
runs to prevent loss of mail due to disk errors and such.....

1- the regular /var/spool/mail or in the users home-dir.
2- /var/spool/alt-mail (probably an NFS mounted partition from the
  host that will keep the 'backed-up' mail)..
...
Is there a better, more efficient way of doing this??  Also, will
all errors be reported back to sendmail??  The only ones I can think
of would be 'wrong permissions on mail spool', 'locks', 'disk fills up'.

Yes.  Create a /etc/procmailrc file that contains:


# Drop root priviledges
DROPPRIVS=yes

# Write to the alternate location
:0c:
/var/spool/alt-mail/$LOGNAME

# If the write failed, bounce the message.  Note that this will
# 'hard' bounce the message -- not simply cause it to be requeued.
# If you want that, change the EXITCODE value from 73=EX_CANTCREAT
# to 75=EX_TEMPFAIL, but be careful!
#
# Also, note that if this occurs, the user's .procmailrc *won't* be
# processed, nor will the message be delivered to the normal mail
# spool location, but this seems like the only reasonable choice
# given the proviso of this whole thing.
:0e
{ EXITCODE=73 HOST }


Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>