procmail
[Top] [All Lists]

User functions in procmail?

1999-03-25 01:44:12

I was wondering if any cycles have been spent on thinking how to set
up procmail "functions", or default actions or something.

I currently have quite a lot of actions that are largely repetitive,
and the current method is to cut-n-paste them in.  It would be neat-o
if we could do something like:

save_and_archive(savefile, archfile)
{
        :0c
        $archfile

        :0A
        $savefile
}


then later, any recipie could do something like:

:0
* ^Subject: .*foo\/.*bar
@save_and_archive($MATCH, arch.$DATE)

:0
* ^TO_ someguy(_at_)thisaddress(_dot_)com
@save_and_archive($HOME/someguy.babblings, $HOME/archive/woot.txt)


and we could reuse that code.

My ideas for syntax (function syntax, using @ to signify a
user-function) are probably biased and whacked, but you see what I'm
getting at, no?

Or is this currently possible and I've missed it?

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