Re: [Exim] Re: Virtual domain question

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Tim Jackson
日付:  
To: exim-users
題目: Re: [Exim] Re: Virtual domain question
Hi Björn, on Thu, 29 Apr 2004 13:35:21 +0200 you wrote:

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


OK, you will want to add your machine's primary hostname to that. Consider
the case of someone sending to postmaster@???.

> 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@???.


Hmm, strange. Have you got the qualify_domain option set to "thaning.se"
by any chance? If so, I'm guessing you then have "root: sten" or similar
in /usr/local/etc/exim/virtual/thaning.se. Not sure why that's not showing
up in exim -bt though.

> This makes a bit of sense, since thaning.se is the canonical hostname of
> the server ($HOST).


Although there's nothing wrong with that, it would probably make things
much less confusing if you made the machine "<something>.thaning.se"
rather than "thaning.se". Otherwise, you're pretty much forcing yourself
to mix up what should be local domains and virtual domains. Much better to
have a clear namespace (<something>.thaning.se).

Let me summarise what I would suggest:

primary_hostname = server.example.com

local_domains = server.example.com : localhost

virtual_domains = example.com : other.domains : foo.bar


and then in /path/to/aliases (used just for local_domains):

postmaster: root
abuse: root
root: postmaster@???
... other system aliases

and in /path/to/virtual/example.com:

postmaster: you@???
some.user: user1@localhost
some.other.user: user2@localhost
... other real users

You can see here how the namespaces are all clearly delineated and there
is no confusion. It assumes that user1@localhost and user2@localhost are
"real" Unix users with real mailboxes, and therefore when
some.user@??? gets rewritten to user1@localhost, a real delivery
is made. (This happens by default in Exim thanks to the "localuser"
router, unless you've removed that).

If you were using Courier, or some other mail system with virtual
mailboxes, you might want to invent another private (perhaps unqualified)
domain e.g. "imap", so then you might have:

virtual_mailbox_domains = imap

then in /path/to/virtual/example.com:

...
some.user: user1@imap
...

and then in your routers:

virtual_mailbox_router:
driver = accept
domains = +virtual_mailbox_domains
transport = virtual_mailbox_transport

virtual_mailbox_transport:
<whatever, maybe deliver to a maildir or something>

> I would think that 'primary_hostname = localhost' would take care of
> that, but it doesn't.


No, don't do that. Leave primary_hostname alone; that should be set to the
true hostname of your machine. It's important for the purposes of
providing meaningful information to others via HELO, SMTP banner, Received
headers etc.


Tim