procmail
[Top] [All Lists]

Re: How to include an on the fly autogenerated file in procmailrc

2007-11-10 19:21:33
On Nov 10, 2007 3:36 PM, Stefano Sabatini
<stefano(_dot_)sabatini-lala(_at_)poste(_dot_)it> wrote:

Here it is my problem: I see that there is the possibility to include
a procmailrc inside another. Would be possible to include a file
autogenerated on the fly, for example using some script, something
like the:
source "script args|"

feature of mutt?

Of course that's just a shorthand for redirecting the output of the
script into a file and then reading the file.  So it's certainly
possible to do that from procmail.  There are any number of ways to do
so; one of them would be:

AUTO_RC = "$HOME/.procmailrc.$$"
:0
* $ ? script args > $AUTO_RC
{ INCLUDERC=$AUTO_RC }

This uses the "* ?" recipe mechanism to execute the script and test
whether it exited successfully before attempting to read the resulting
file.

Cleaning up the file afterward has been left to the imagination of the reader.
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail