Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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" )
    elif $h_X-SIGN-ADDED: is not contains "yes"
        headers add "X-SIGN-ADDED: yes"
        seen pipe "/etc/mailsystem/sign/ $sender_address $recipients"

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


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

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

Your Answer


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.