procmail
[Top] [All Lists]

Re: Using personal .procmailrc over global .procmailrc

2002-02-13 22:07:29
Michael J Wise <mjwise(_at_)kapu(_dot_)net> writes:
...
Thing is, if you use the !, you don't have to include the above two lines
in the recipe, and you can just have the default behavior be the "Right
Thing", which ... appeals to me more.

Instead, you have to wrap the rest of the rcfile in braces and procmail
has to read and parse the entire file to see whether you put anything
after the close brace.  Assignments to SWITCHRC cause the current rcfile
to be abandoned immeadiately.


      :0
      * ! ? [ -f $HOME/.procmailrc ]
...
BTW, "[" == "test".

That'll probably be less efficient than
        :0
        * ! ? test -f $HOME/.procmailrc

Why?  Because the presence of the '[' and ']' make procmail use a shell to
execute the line instead of invoking the test binary directly.  Even if
'[' is builtin to the shell, this will still probably be slower.


Of course, determining $HOME could get tricky, seeing as it isn't set up
at that point, methinks. But ICBW.

Procmail sets the various variables including LOGNAME and HOME before
processing the /etc/procmailrc file.


Philip Guenther
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail