[Exim] Re: Virtual domain question

Góra strony
Delete this message
Reply to this message
Autor: Björn Lindström
Data:  
Dla: exim-users
Temat: [Exim] Re: Virtual domain question
Tim Jackson <lists@???> writes:

> Make sure that local_domains contains only truly "local" things like the
> hostname of the machine itself, aliases of that etc.
>
> Then add
>
> domains = +local_domains
>
> to the system_aliases router.
>
> By far the best way (and simplest, as it avoids confusion) of dealing
> with situations like this is to maintain a complete separation between
> your "virtual" and "local" domains, meaning that a delivery to a user
> only takes place when an alias in a "virtual" domain file redirects to
> user@localhost or similar.


Ok. I did something like that here. +internal_domains for now contains
only 'localhost'.

virtual:
driver = redirect
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

system_aliases:
driver = redirect
allow_fail
allow_defer
domains = +internal_domains
data = ${lookup{$local_part}lsearch*{/usr/local/etc/exim/aliases}}
user = mailnull
group = mail
file_transport = address_file
pipe_transport = address_pipe

In the file aliases I have 'root: bkhl@???', and in
virtual/elektrubadur.se, I redirect bkhl to the uni account where I
really read my mail.

Now this works fine if I run 'exim -bt -d root'. It rewrites stuff like
this:

bkhl@???
    <-- bkhl@???
    <-- root@localhost


However, if I do 'echo test|mail -s test root', or
'echo test|mail -s test root@localhost', it goes to the user
sten@???.

This makes a bit of sense, since thaning.se is the canonical hostname of
the server ($HOST). I would think that 'primary_hostname = localhost'
would take care of that, but it doesn't.

How should I go about fixing that last kink?

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