Re: [Exim] routing over an entire message.

Pàgina inicial
Delete this message
Reply to this message
Autor: Vadim Vygonets
Data:  
A: exim-users
Assumpte: Re: [Exim] routing over an entire message.
Quoth Dave on Mon, Feb 14, 2000:
> However, suppose my emails are of the form:
>
> user@???             

>
> and I would still want to route emails to individual machines.
> ie, have a centeral mail hub that forwards emails to a mail server
> in each department, how would I do this?


On your main mail server, you can set up a domainlist router
which would look up the local-part of the e-mail address and
route it to the relevant smaller mail server within the company.
If the local part is not in the database, the mail should be
bounced with an "unknown user" error. It can be accomplished by
a router such as:

mailhub_unknown:
  driver = domainlist
  transport = remote_smtp
  route_list = "company.com    ${lookup{$local_part}dbm{/var/exim/user_department.db}{$value.company.com}fail}    bydns_a"


where /var/exim/user_department.db contains entries such as:

weasel:    sales
liar:    market
bofh:    admin


which cause mail to, say, weasel@??? be delivered to the
mail server sales.company.com.

Of course, you must handle addresses like weasel@???
correctly and forward it to the relevant mail server. See Q0309
in the FAQ.

You can setup the smaller mail servers to deliver mail to the
user's mailbox if the local part of the address is in the local
database, and send it to the main mail server otherwise. See
Q0403 in the Exim FAQ. You may want to add "domains =
company.com" so mail to unknown users at (say) sales.company.com
would still bounce, instead of going to the central mail hub.
No, "You may want" is the wrong thing to say here. "You'd
better" seems more appropriate, because you may want your mails
not to bounce back and forth between the main mail hub and the
smaller mail server in case of any misconfiguration.

Yeah, it means that on smaller mail servers you must set
local_domains to something like "sales.company.com : company.com"
to treat both domains as local, to some extent.

Side effects: when mail is sent to, say, root@???, it
gets delivered to the local root (or, if you're sane, to the
person root is aliased to). If you want to disable this
behavior, you'll need to add "domains = sales.company.com" to the
aliasfile director (and, probably, several others). But it means
that if weasel's account is closed and he wants his mail
forwarded to his other account, the alias must be set up on both
sales.company.com and the main mail hub to handle both
weasel@??? and weasel@??? corrrectly.

Anyway, your machines, you decide. You may also want to rewrite
addresses instead of bouncing them, or to keep a list of known
local parts on every mail server or accessible via LDAP or SQL,
or make all the servers forward mail directly to the target mail
server within your company without passing tthrough the main mail
hub... Whatever. Several beautiful solutions exist.

And now, *** ADVERTISEMENT ***.

Being unemployed, I have time to answer mail on exim-users. If
you want me to continue, inform every possible company in Israel
not to hire me. If you arre a kind soul, find me a job. In
Israel. Or UK.

Vadik.

-- 
Yes, you can get an account if you promise not to wear ties
anymore.
    -- Unknown sysadmin, 1998-10-27.