Andersson Guru
Joined: 12 Jul 2003 Posts: 525 Location: Göteborg, Sweden
|
Posted: Sat May 01, 2004 4:18 pm Post subject: Procmail, using variables in the condition? |
|
|
I have a few procmail filters that should only apply to certain email addresses (mailing lists) and I'm trying to make these easier to maintain. I'd like to have these addresses in a variable and use use that variable in the condition lines. I can't figure out how to use this variable however.
For example:
Code: | MAILINGLISTS=(address1@domain.org|address2@otherdomain.org)
:0
* ^To.* $ ${MAILINGLISTS}
$MAILDIR/test/ |
This should move all email to these lists to the test directory, right? It works if I insert the value of $MAILINGLIST myself, like this:
Code: | :0
* ^To.*(address1@domain.org|address2@otherdomain.org)
$MAILDIR/test/ |
so the regexp is working, the problem must be using the variable. All the examples I've found that uses variables look like mine.
edit:
Ok, I moved the first $ to the beginning of the line, right after the * Code: | *$ ^To.* ${MAILINGLISTS} | This seems to work. |
|