Virtual domain

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: liaison
Fecha:  
A: exim-users
Cc: liaison
Asunto: Virtual domain
Hi,

I would like to complete this setup fairly quickly so that it could be
used as an example in the exim distribution. This is my first serious
attempt at using exim in a non-trivial environment... Any help appreciated!

I am trying to setup a mail hub to handle virtual domains. My
understanding is that I create MX records for the domain pointing to my
mail hub. When the mail arrives at the hub a decision is made on how to
route the mail to the destination. The routing to the local machines
(assuming it is over SMTP) cannot use MX records as a mail loop would
occur, so just the A records are looked up (bydns_a?).

I have setup the virtual domain example as described in 39.2 but it
doesn't do what I want. The setup is:

    wallace.csv.shu.ac.uk        mail hub
    northern-college.shu.ac.uk    virtual domain
    cfldcol.ac.uk            virtual domain


There are some users on the mail hub who need to send / receive mail.

Mail for northern-college.shu.ac.uk is routed to a machine over a dial-up
link. I cannot initiate the dial at this end, so I will need to kick the
queue for this machine manually when the link comes up - exim -M or -R?
The mail machine at the remote end is studrec.northern-college.shu.ac.uk.

Mail for cfldcol.ac.uk is routed via SMTP over a dedicated link to
machine chest-net.cfldcol.ac.uk.

I want to re-write addresses for users in the two virtual domains, but
not for users on the mail hub. For instance:

xcode@??? <->
A.User@???

ycode@??? <-> A.User@???

The above scenario implies I need to re-write the message envelope and
headers.

In the config file, I have:

[main]

local_domains = "wallace.csv.shu.ac.uk:\
        dbm;/usr/local/etc/exim/domain"


smtp_accept_max = 20
smtp_accept_reserve = 2
smtp_reserve_hosts = dbm;/usr/local/etc/exim/reserve

[transports]

local_delivery:
driver = appendfile;
file = /var/mail/${local_part}

smtp:
driver = smtp;

[directors]

system_aliases:
driver = aliasfile;
file = /etc/aliases,
search_type = lsearch

localuser:
driver = localuser,
transport = local_delivery;

virtual:
domains = dbm;/usr/local/etc/exim/domain,
driver = aliasfile,
no_more;
file = /usr/local/etc/exim/$domain,
search_type = lsearch

[routers]

lookuphost:
driver = lookuphost,
transport = smtp;

literal:
driver = ipliteral,
transport = smtp;

The file/dbm contents are as follows:

domain:
northern-college.shu.ac.uk
cfldcol.ac.uk

reserve:
studrec.northern-college.shu.ac.uk
chest-net.cfldcol.ac.uk

northern-college.shu.ac.uk:
xcode:A.User
A.User:xcode

I'm not sure :

    a) how to re-write the usernames <-> friendly names
    b) how to re-write the domains
    c) whether exim -bt <address> will show me both the internal and 
external forms of the addresses that are re-written


Some tests:

# /opt/exim/bin/exim -bt root@???
root@???
local delivery to root in domain wallace.csv.shu.ac.uk
director = localuser, transport = local_delivery

Looks Ok.

# /opt/exim/bin/exim -bt A.User@???
root@???
    <-- A.User@???
  local delivery to root in domain wallace.csv.shu.ac.uk
  director = localuser, transport = local_delivery


Wrong! Should go to xcode@???.

# /opt/exim/bin/exim -bt xcode@???
root@???
    <-- A.User@???
    <-- xcode@???
  local delivery to root in domain wallace.csv.shu.ac.uk
  director = localuser, transport = local_delivery


Wrong! As above.

Help! Thanks,

Dave Haywood
liaison@???