Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i am trying to setup exim system filter, it should be skipped for certain recipients, but condition always fails:

Filter looks like:

# Exim filter
if foranyaddress $h_to: ( $thisaddress contains "lists.example.loc" )
    then
        finish
    elif $h_X-SIGN-ADDED: is not contains "yes"
    then
        headers add "X-SIGN-ADDED: yes"
        seen pipe "/etc/mailsystem/sign/sign.py $sender_address $recipients"
endif

my test.msg is

Message-ID: <4FE823B6.9040905@exmaple.loc>
Date: Mon, 25 Jun 2012 12:39:18 +0400
From: Hikaru <test@lists.exmaple.loc>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0
MIME-Version: 1.0
To: <testuser@lists.exmaple.loc>
 Subject: 1
 Content-Type: text/plain; charset=UTF-8; format=flowed
 Content-Transfer-Encoding: 7bit

 1

And command to run testing is:

exim -bF exim.filter -f sender@example.loc -bfd lists.example.loc <test.msg

Why it always runs pipe to script? Thanks in advance

share|improve this question
add comment

1 Answer 1

Seems to me, I found why it won't work: "foranyaddress" condition waits for list of addresses and won't work if there is only one recipient. So, if "To:" header will be expanded to several addresses everything would work.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.