Re: [exim] Virtual Domains

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Joshua Lokken
日付:  
To: Timur
CC: exim-users
題目: Re: [exim] Virtual Domains
On Tue, 14 Dec 2004 19:13:13 +0300, Timur <itabox@???> wrote:
> Hello exim-users,
>
> I try to setup my Exim 4.30 to handle several domains which are hosted
> on my server. And I have several troubles. Please, let me know, what
> is wrong. Here is my state:
>
> 1. Domains: domain1, domain2, domain3 - all of them are resolved via
> DNS, and MX records for all of them are pointing to my mail server.
>
> 2. My users: user1, user2, user3,...,userNN
>
> 3. My basic domain is "domain1" and all my users have e-mails like:
> userXX@domain1.
>
> According the Exim's documentation I added a new router:
>
> my_domains:
>    driver = accept
>    domains = dsearch;/etc/mail/domains
>    local_parts = lsearch;/etc/mail/domains/$domain
>    transport = my_mailboxes

>
> and new transport:
>
> my_mailboxes:
>    driver = appendfile
>    file = /var/mail/$domain/$local_part
>    user = mail

>
> into my Exim configuration file. Each of my /etc/mail/domains/domainXX
> files contains records like:
> user1:         user1
> user2:         user2
> .
> .
> .
> userNN:        userNN

>
> But when I send messages to address userXX@domain1, the message is added
> to the /var/mail/userXX file, and when I send a message to the same
> user using other address userXX@domain2, the message is added into
> /var/mail/domain2/userXX file. Moreover, I can't implement aliases in
> my virtual domains with such configuration. Another trouble is my POP3
> daemon (Qpopper 4.0.5) doesn't fetch mail from virtual directories,
> only from /var/mail/ directory.
>
> I'd like to have the following e-mail addressing scheme:
>
> 'domain1' contain users: user1, user2, user3,...,userNN
> 'domain2' contain users: user2, user3, user4, user5
> 'domain3' contain users: user1, user5, user@some_other_domain
>
> How to implement this scheme of mail addressing?


I have a similar setup, and thanks to folks from this list, it's
now working quite well. I have (in /usr/locla/etc/exim/configure):


domainlist  local_domains = "server.host.domain :\
                                      dbm;/usr/local/etc/exim/domains.dbm"



And in /usr/local/etc/exim/domain1.org:

user1:          user_a (local user account)
user2:          user_a
user3:          other@???
*:                 :fail: The user "$original_local_part" does not exist
                             at "$original_domain"



So, if I do:

# exim -bt user1@???,    I get
user_a@???
        <----------  user1@???
        router = localuser, transport = local_delivery



And if I try an undefined address from domain1.org, I get:

# exim -bt nonuser@???
nonuser@??? is undeliverable
The user "nonuser" does not exist at "domain1.org"

The alias files are very flexible, you can do things like:

user_w:         addr@???          # You can forward mail for a user
user_x:         "|/path/to/some/script"  # You can use pipes
user_y:         :fail: No user "user" here!
user_z:         :blackhole:
*:                  user_a




HTH,
--
Joshua Lokken
Open Source Advocate