-   Linux - Software (
-   -   Multiple Domains with Exim 4.34 (

jonwatson 09-27-2004 08:49 AM

Multiple Domains with Exim 4.34
Hello all....

I've looked around the forums and read what's there, and I'v also read the Exim FAQ, but I'm still having problems.

I think what I want to do is pretty routine, but I don't know enough about email to make it happen.

My linux box's domain is I have all servers (web, ftp, email, etc) running just fine on that domain. Now I want to move another of my domains over (

The webserver part is fine, it's running, but I can't seem to wrap my head around how to get my box to accept and deliver traffic for the domain.

I have multiple email addresses, in fact too many to handle, so I think what I want to do is have all email put into a specific email box.

This is the snippet of the Exim doc I am working with:


Q0402:  How do I arrange for all incoming email for *@some.domain to go into one pop3 mail account? The customer doesn't want to add a list of specific local parts to the system.

A0402:  Set up a special transport that writes to the mailbox like this:

    driver = appendfile
    file = /pop/mailbox
    user = exim

The file will be written as the user exim. Then arrange to route all mail for that domain to that transport, with a router like this:

    driver = accept
    domains = some.domain
    transport = special_transport

I understand that I have to modify /pop/mailbox to read /var/mail/<username> and that some.domain should be changed to

My question is ..where do I put this stuff? I'm using exim 4.34 and therefore have an /etc/exim4 directory. In that directory there are directories for router and transport which are filled with individual files. I assumed from this that I was to create new files in these directories and plunk the apppropriate code in there, but that doesn't work.

When I send an email to a address, it get's bounced with the following error:


This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es)
    Too many "Received" headers - suspected mail loop

------ This is a copy of the message, including all the headers. ------

Return-path: <>
Received: from theheatsinkbbs ([])
        by theheatsinkbbs with esmtp (Exim 4.34)
        id 1CBvU9-0001h4-Sc
        for; Mon, 27 Sep 2004 07:24:09 -0600
Received: from theheatsinkbbs ([])
        by theheatsinkbbs with esmtp (Exim 4.34)
        id 1CBvTe-0001gz-1d
        for; Mon, 27 Sep 2004 07:23:38 -0600

The 'Received' header gets repeated about 50 times....

Any ideas?



foo_bar_foo 09-27-2004 11:55 AM

hi try this
(i think this domainlist can still contain your actual machine domain as well)

domainlist local_domains = @ : \
    @[] : \
    localhost : \

then under directors configuration after the real_local: section is over make a new virtual: section

  driver = redirect
  data = ${lookup{$local_part@$domain}lsearch*@{/etc/exim4/virtual.users}}
  domains = partial-lsearch;/etc/exim4/

then just make some files that look like this

--- ---

--- virtual.users ---    : localuser  :
  *              : catchalluser    : localuser2  :
  *              : catchall2

jonwatson 09-27-2004 12:51 PM


Originally posted by foo_bar_foo
[B]hi try this

Thanks for the response. I tried your suggestion and the routing seems to's what I get when I run an exim -d -bt


theheatsinkbbs:/etc/exim4# /usr/sbin/exim4 -d -bt
Exim version 4.34 uid=0 gid=0 pid=7968 D=fbb95cfd
Berkeley DB: Sleepycat Software: Berkeley DB 3.2.9: (May 26, 2004)
Support for: iconv() IPv6 GnuTLS
Lookups: lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmnz dsearch nis nis0 passwd
Authenticators: cram_md5 plaintext
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/maildir/mailstore autoreply lmtp pipe smtp
Fixed never_users: 0
changed uid/gid: forcing real = effective
  uid=0 gid=0 pid=7968
  auxiliary group list: <none>
configuration file is /var/lib/exim4/config.autogenerated
log selectors = 00000ffc 00010400
trusted user
admin user
user name "root" extracted from gecos field "root"
originator: uid=0 gid=0 login=root name=root
sender address =
Address testing: uid=0 gid=104 euid=0 egid=104
--------> hubbed_hosts router <--------
checking domains
expansion of "${if exists{/etc/exim4/hubbed_hosts}{partial-lsearch;/etc/exim4/hubbed_hosts}fail}" forced failure: assume not in this list
hubbed_hosts router skipped: domains mismatch
--------> dnslookup_relay_to_domains router <--------
checking domains
search_open: lsearch "/etc/exim4/"
search_find: file="/etc/exim4/"
  key="" partial=2 affix=*. starflags=0
LRU list:
internal_search_find: file="/etc/exim4/"
  type=lsearch key=""
file lookup required for
  in /etc/exim4/
lookup yielded: in "@ : @[] : localhost: partial-lsearch;/etc/exim4/"? yes (matched "partial-lsearch;/etc/exim4/")
data from lookup saved for cache for +local_domains: in "! +local_domains : +relay_to_domains"? no (matched "! +local_domains")
dnslookup_relay_to_domains router skipped: domains mismatch
--------> dnslookup router <--------
checking domains
cached yes match for +local_domains
cached lookup data = in "! +local_domains"? no (matched "! +local_domains" - cached)
dnslookup router skipped: domains mismatch
--------> real_local router <--------
real_local router skipped: prefix mismatch
--------> virtual router <--------
checking domains
search_open: lsearch "/etc/exim4/"
  cached open
search_find: file="/etc/exim4/"
  key="" partial=2 affix=*. starflags=0
LRU list:
internal_search_find: file="/etc/exim4/"
  type=lsearch key=""
cached data used for lookup of
  in /etc/exim4/
lookup yielded: in "partial-lsearch;/etc/exim4/"? yes (matched "partial-lsearch;/etc/exim4/")
calling virtual router
rda_interpret (string): ${lookup($local_part@$domain}lsearch*@{/etc/exim4/virtual.users}}
virtual router: defer for
  message: failed to expand "${lookup($local_part@$domain}lsearch*@{/etc/exim4/virtual.users}}": missing lookup type cannot be resolved at this time:
  failed to expand "${lookup($local_part@$domain}lsearch*@{/etc/exim4/virtual.users}}": missing lookup type
search_tidyup called
>>>>>>>>>>>>>>>> Exim pid=7968 terminating with rc=1 >>>>>>>>>>>>>>>>

I'm not savvy enough to intrepret all of this, but it appears that the 'failed to expand...' line probably contains a clue...I just don't know how to read it properly.

I have the following and virtual.users files as well:


#virtual domains

Code: : heatsink
* : heatsink : heatsink
* : heatsink




PS - should mention also that the messages are definitely arriving at the box. Here's a snippet of my mailq


theheatsinkbbs:/etc/exim4# mailq

52m  1.1K 1CBywA-0001zA-4G <>

37m  1.1K 1CBzAr-00021g-3v <>

36m  1.1K 1CBzB3-00021h-R0 <>


I put the 'xxx''s in to save my work email address from publication :)

All times are GMT -5. The time now is 09:00 AM.