[Exim] Re: Virtual domain question

Top Page
Delete this message
Reply to this message
Author: Björn Lindström
Date:  
To: exim-users
Subject: [Exim] Re: Virtual domain question
"Peter Bowyer" <peter@???> writes:

> Didn't we have a long exchange of emails about this a few days ago?
> What happened?


I have managed to almost achieve my goal, with these two routers:

system_aliases:
driver = redirect
condition = "${if and {{!eq {$received_protocol}{local}}} {1}{0}}"
allow_fail
allow_defer
data = ${lookup{$local_part}lsearch*{/usr/local/etc/exim/aliases}}
user = mailnull
group = mail
file_transport = address_file
pipe_transport = address_pipe

virtual:
driver = redirect
condition = "${if and {{eq {$received_protocol}{local}}} {1}{0}}"
allow_fail
allow_defer
domains = dsearch;/usr/local/etc/exim/virtual
data =
${lookup{$local_part}lsearch{/usr/local/etc/exim/virtual/$domain}}
user = mailnull
group = mail
file_transport = address_file
pipe_transport = address_pipe
no_more


These route local mail according to /usr/local/etc/exim/aliases, and
mail from the outside according to /usr/local/etc/exim/virtual/DOMAIN.

The problem left is with the conditionals. While this works correctly
for local administrative mails, from services such as crond, it doesn't
work when a local user sends mail to another user on the system. In
those latter cases, I want the domain-specific alias files to apply.

So, how would I make a conditional that instead (or in addition to) of
checking $received_protocol, somehow sees if a mail was adressed to
'user@localhost' or to 'user@some_domain'.

--
Björn Lindström <bkhl@???>
http://bkhl.elektrubadur.se/