[exim] disable srs for my domains

Top Page
Delete this message
Reply to this message
Author: Przemyslaw Zoltowski
Date:  
To: exim-users
Subject: [exim] disable srs for my domains
Hello,

I have an MTA which is used to forward emails to specific mail systems. My users can choose between 2 my internal systems (lets name it 'system1' and 'system2') and forward to any of his external mailboxes (by external I mean outside my company). To make my forwards reach external destinations i needed to implement SRS. Everything works jus fine, but I want to disable SRS for my local systems (system1 and system2), because I accept all mails forwarded from this host. Exim uses /etc/aliases to decide where to forward email.

Let's suppose Exim is local doamin for company.com and in /etc/aliases I have:

user1: system1.company.com
user2: system2.comapny.com
user3: external.mail.system.com

My configuration of srs in exim.conf looks like this:

# SRS
srs_bounce:
debug_print = "R: srs_bounce for $local_part@$domain"
driver = redirect
allow_fail
allow_defer
# domains = $primary_hostname
domains = $qualify_domain
local_part_prefix = srs0+ : srs0- : srs0= : srs1+ : srs1- : srs1=
caseful_local_part
address_data = ${readsocket{/tmp/srsd}{REVERSE $local_part_prefix$local_part@$domain}{5s}{\n}{:defer: SRS daemon failure}}
data = ${if match{$address_data}{^ERROR}{:fail: Invalid SRS address}{$address_data}}


srs_forward:
  debug_print = "R: srs_forward for $local_part@$domain"
  no_verify
  senders = ! : ! *@+local_domains
  address_data = ${readsocket{/tmp/srsd}\
                {FORWARD $sender_address_local_part@$sender_address_domain $qualify_domain\n}\
                                        {5s}{\n}{:defer: SRS daemon failure}}
  errors_to = ${quote_local_part:${local_part:$address_data}}@${domain:$address_data}
  headers_add = "X-SRS: Sender address rewritten from <$sender_address> to <${quote_local_part:${local_part:$address_data}}@${domain:$address_data}> by $primary_hostname."
  driver = redirect
  repeat_use = false
  allow_defer
  data = ${quote_local_part:$local_part}@$domain
# SRS


I tried to put in srs_forward:
domains = ! system1.company.com : ! system2.comapny.com

but it doesn't work. I think that when Exim checks above condition, because it compare domain to original recipient (before router)

Does anyone can help me write working condition to achieve my aim ?

Greetings
pz