Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Procmail, using variables in the condition?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Andersson
Guru
Guru


Joined: 12 Jul 2003
Posts: 525
Location: Göteborg, Sweden

PostPosted: Sat May 01, 2004 4:18 pm    Post subject: Procmail, using variables in the condition? Reply with quote

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. :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum