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'm trying to send a notification to the sender of a message when a message is send to exactly one address in the local domain (

Q1: How would be the syntax for the condition (the above don't work) ? :

    domains = +local_domains
    senders = ! ^.*-request@.*:\
            ! ^bounce-.*@.*:\
            ! ^.*-bounce@.*:\
            ! ^owner-.*@.*:\
            ! ^postmaster@.*:\
            ! ^webmaster@.*:\
            ! ^listmaster@.*:\
            ! ^mailer-daemon@.*:\
            ! ^root@.*:\
            ! ^noreply@.*

    condition = ${if eq {$received_for}{}}


Q2: How to write multiline string in the config file for "text" ? :

    subject=Your mail for
    text="Please resend your messasge to

This is a temporary modification."
share|improve this question
up vote 1 down vote accepted

Q1: conditions operate on the strings "true"/"yes" or "no"/"false", so you have to make the end result of your expansions be one of those strings. Likewise, ${if doesn't return an absolute true or false, it evaluates the statement and then returns strings based on the truth of the statement (you left those strings off). Here're some example:

g3 0 /home/jj33 > exim -be
> ${if eq{string}{string}{true}{false}}
> ${if eq{string}{STRING}{true}{false}}
> ${if eqi{string}{STRING}{true}{false}}

It's important to note that the "true" and "false" strings are arbitrary, you ${if can return any value, but true and false are the most useful to you here. Anyhoo, based on the condition you list, I would change it to this:

condition = ${if eq {$received_for}{}{yes}{no}}

EDIT: I think newer versions of exim may not require the extra "if-true" and "if-false" parts, so I may be barking up the wrong tree here. I think that $received_for is probably actually not the variable you want, I doubt that it contains anything at the time you are running that router. Instead, try this:

condition = ${if eqi{$local_part@$domain}{}}

Q2: There are a few ways to solve this problem, but I like to use the ${expand: operator:

g3 0 /home/jj33 > exim -be
> ${expand:line1\nline2}

So, in your case, it would be:

text=${expand:Please resend your messasge to\n\\n\nThis is a temporary modification.}
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.