Subject: Global Recipe for storing undeliverable mail?

From: (Dave Lopata) <[email-masked]>
Date: Wed, 15 Mar 1995 15:10:23 -0500

...

	Howdy.  I've got our system mailer setup to deliver to
$HOME/.mailspool, via procmail.  Most of these $HOME areas are, of
course, NFS mounted, and some of them tend to disappear every once in
a while, for an extended period, and procmail reports that it cannot
deliver the mail.

	I'm trying to figure out if the following recipe will work, if
I place it in /usr/local/etc/procmailrc:

:0 w:
$DEFAULT

:0 e:
/var/alt.mail/$LOGNAME

	Basically, I want procmail to make an attempt at delivering
mail normally but if it cannot, rather than bouncing or reporting an
error, I'd like it to be delivered to an alternate mail spool.

	Additionally, I was wondering if I can setup a receipt that,
if procmail *can* deliver to the $DEFAULT, it will also check for
anything existing in the /var/alt.mail/$LOGNAME, and deliver that as
well. . .

	Thanks.

---

From: Alan Stebbens <[email-masked]>
Date: Wed, 15 Mar 1995 17:23:50 -0800

> a while, for an extended period, and procmail reports that it cannot

We had this problem until we replaced the "Mlocal" configuration in
sendmail.cf with the one using "procmail", which was configured to
*ONLY* do dot-locking.  You must tell procmail to never use any kernel
advisory locking.  You should also advise your users to use mail clients
which also only do "dot" locking, or use the POP or IMAP daemons from
the "pine" distribution, configured to only do "dot" locking.

Also, for each mail drop into a filesystem, which fail, you need to
provide alternates, such as:

    ALTERNATE=/var/alt.mail/$LOGNAME

    :0 w:
    $DEFAULT
	:0e:
	$ALTERNATE

Myself, I use the following recipes, in which I use MH folders, and fall
back to $DEFAULT, and then fall back to $FAILDROP on yet another
filesystem.

The recipes below would be easier if procmail had some kind of macros
with arguments (like cpp macros).

# ...
#  7. If any maildrops fail (file system full, drop in $DEFAULT, then $FAILDROP)
# ...
# Detect loops right away -- and stop them
:0:
* $ ^X-Loop: *$MY_ADDR
$INBOX
    :0e:
    $DEFAULT
	:0e:
	$FAILDROP

# If the mail is to me, do some special things
:0
* ^TO(aks)
{

    ############################################
    # Check for any commands on the Subject line
    ############################################
    INCLUDERC=$HOME/.commandrc

    # Don't ack our staff or people who we don't want to send acks to
    :0:
    * $ $FROM$NOACKS
    $INBOX
	:0e:
	$DEFAULT
	    :0e:
	    $FAILDROP

    # Do any autoacknowledgements
    INCLUDERC=$LIB/ackmail.rc

    # If the mail is directly to me, -> +inbox
    :0:
    * $ $TO(aks)([,@]|$)
    $INBOX
	:0e:
	$DEFAULT
	    :0e:
	    $FAILDROP

   ...