procmail
[Top] [All Lists]

Re: Robust procmail invocation

1995-11-29 18:41:43
R Hannes Beinert <oracle(_at_)dodona(_dot_)com> wrote:
Currently when I use procmail for testing, I've been using the following
construct in my .forward:

    "|IFS=' '&&exec `grep '^oracle:' /etc/passwd | 
     cut -d: -f6`/bin/procmail -f-||exit 75 #oracle"

My intention in using this invocation is to guard against any possible
pathname changes my provider might make to the location of my copy of
procmail.  The ability to use the $HOME or tilde constructs would be
ideal, were they to be available.  

forking of two extra processes for every piece of mail, which is not
optimal.

You could use the .forward that is currently the recommended generic
.forward in the procmail man page:

        "|IFS=' '&&p=/your/home/bin/procmail&&test -f $p&&exec $p -Yf-
          ||exit 75 #YOUR_USERNAME"

This should all be on one line.  If procmail ever vanishes, this should
requeue the mail.

And, in addition to this, run a cron job which checks the location of
your home directory once a day (or every hour, depending on how much mail
you get).  If it changed, have it rewrite the .forward file.
-- 
Sincerely,                                                          
srb(_at_)cuci(_dot_)nl
           Stephen R. van den Berg (AKA BuGless).

"Always look on the bright side of life!"

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