procmail
[Top] [All Lists]

Re: INCLUDERC and directories of rc files

2001-10-31 02:38:30

I know of no other way to include files than explicite INCLUDERC lines.
Your best bet might be to use 'make' or a homegrown tool to amalgamate
various recipes into a single included rc file.  Something like:

        cat ~/.procmail/foo/* > ~/.procmail/foo.rc

and an INCLUDERC=~/.procmail/foo.rc

You could get fancy and build a small script that would copy only the
recipes named in another file.  Something like:

        #!/bin/sh
        echo -n "" > /tmp/prrecipes.$$
        grep '^[a-z]' ${HOME}/.procmail/recipes | while read recipe ; do
                if [ -r ${HOME}/.procmail/foo/${recipe}.rc ]; then
                        cat ${HOME}/.procmail/foo/${recipe} >> /tmp/prrecipes.$$
                fi
        done
        if [ -s /tmp/prrecipes.$$ ]; then
                mv /tmp/prrecipes.$$ ${HOME}/.procmail/foo.rc
        else
                rm -f /tmp/prrecipes.$$
        fi

Then just populate ~/.procmail/recipes with the list of .rc files you
want included.  This would have to be run every time you changed your
recipe list.

Another possibility might be to run an INCLUDERC which was built by a
back-quoted command line.  I haven't tested whether this would work,
but it seems reasonable.  You'd have a line like:

        INCLUDERC=`/path/to/foo`

and /path/to/foo would spit stdout a string that pointed to another file
to include, which might in turn point to other collections of files.  It
would require a certain level of evil to implement something like this,
but I believe it would work.

Is any of this helpful?


On Tue, Oct 30, 2001 at 11:12:51PM -0500, Timothy Lu Hu Ball wrote:

So say I have a directory called ~/.procmail/foo/ and inside foo/ I have
a pile of separate mini-procmail recipies I would procmail to include.
Is there a good way of doing this? My first thought would be for 

INCLUDERC=~/.procmail/named-pipe

and have a daemon attach to the pipe and spit out the recipies... but
this would be slow and the deamon would have to wake up each time a user
got mail. I don't know if that would be slow or not but it wouldn't be
pretty...

Can anyone else think of a better way for me to do this? (and I think
resorting to having a separate INCLUDERC line for each file would be
"bad")

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

-- 
  Paul Chvostek                                             
<paul(_at_)it(_dot_)ca>
  Operations / Development / Abuse / Whatever       vox: +1 416 598-0000
  IT Canada                                            http://www.it.ca/

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

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