procmail
[Top] [All Lists]

Re: Need to deliver mail to 2 different spool areas

1997-02-12 14:53:43
On Wed, 12 Feb 1997, Philip Guenther wrote:

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!

Just to clarify:
you are saying to just call the standard system procmail in sendmail.cf :
 Mlocal P=/usr/local/bin/procmail ....
and then in the 'system' (/etc/procmailrc), just do a delivery to the
alt-mail spool first and then it will deliver to the default also and
run any users .procmailrc's... (in an ideal world..)

#
# 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 }

yes...hmmm...this could be a bit of a problem.....,but I'll see if it
is that much of a concern...  since if mail isn't delivered...it should
bounce back...  I also don't wouldn't want duplicate mails to be delivered
or bounced....

Thank you so much for your response....


Philip Guenther


/////////////////////////////////////////////////////////////////////////////
pamela(_at_)infi(_dot_)net                                Pamela J. Skillman
http://www.usgcc.odu.edu                       Systems Engineer III
                                               Systems Engineering
                                               InfiNet
(757) 624-2295 (x3082)
(757) 624-2473  FAX                              
/////////////////////////////////////////////////////////////////////////////

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