LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Multiple Domains with Exim 4.34 (https://www.linuxquestions.org/questions/linux-software-2/multiple-domains-with-exim-4-34-a-235748/)

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 theheatsinkbbs.ca. I have all servers (web, ftp, email, etc) running just fine on that domain. Now I want to move another of my domains over (jonwatson.ca).

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 jonwatson.ca domain.

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

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

Code:

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:

  special_transport:
    driver = appendfile
    file = /pop/mailbox
    envelope_to_add
    return_path_add
    delivery_date_add
    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:

  special_router:
    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 jonwatson.ca.

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 jonwatson.ca address, it get's bounced with the following error:

Code:

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)
failed:

  me@jonwatson.ca
    Too many "Received" headers - suspected mail loop

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

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

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

Any ideas?

Thanks!

Jon

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)
Code:

domainlist local_domains = @ : \
    @[] : \
    localhost : \
    partial-lsearch;/etc/exim4/virtual.domains

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

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

then just make some files that look like this
Code:

--- virtual.domains ---
  example.com
  example.net
---

--- virtual.users ---
  #example.com
  regularuser@example.com    : localuser
  forwardinguser@example.com  : someuser@example.org
  *@example.com              : catchalluser

  #example.net
  regularuser@example.net    : localuser2
  forwardinguser@example.net  : someuser2@example.org
  *@example.net              : catchall2
---


jonwatson 09-27-2004 12:51 PM

Quote:

Originally posted by foo_bar_foo
[B]hi try this
Hi

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

Code:

theheatsinkbbs:/etc/exim4# /usr/sbin/exim4 -d -bt me@jonwatson.ca
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 = root@theheatsinkbbs.ca
Address testing: uid=0 gid=104 euid=0 egid=104
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Testing me@jonwatson.ca
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Considering me@jonwatson.ca
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
routing me@jonwatson.ca
--------> hubbed_hosts router <--------
local_part=me domain=jonwatson.ca
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 <--------
local_part=me domain=jonwatson.ca
checking domains
search_open: lsearch "/etc/exim4/virtual.domains"
search_find: file="/etc/exim4/virtual.domains"
  key="jonwatson.ca" partial=2 affix=*. starflags=0
LRU list:
  :/etc/exim4/virtual.domains
  End
internal_search_find: file="/etc/exim4/virtual.domains"
  type=lsearch key="jonwatson.ca"
file lookup required for jonwatson.ca
  in /etc/exim4/virtual.domains
lookup yielded:
jonwatson.ca in "@ : @[] : localhost: partial-lsearch;/etc/exim4/virtual.domains"? yes (matched "partial-lsearch;/etc/exim4/virtual.domains")
data from lookup saved for cache for +local_domains:
jonwatson.ca in "! +local_domains : +relay_to_domains"? no (matched "! +local_domains")
dnslookup_relay_to_domains router skipped: domains mismatch
--------> dnslookup router <--------
local_part=me domain=jonwatson.ca
checking domains
cached yes match for +local_domains
cached lookup data =
jonwatson.ca in "! +local_domains"? no (matched "! +local_domains" - cached)
dnslookup router skipped: domains mismatch
--------> real_local router <--------
local_part=me domain=jonwatson.ca
real_local router skipped: prefix mismatch
--------> virtual router <--------
local_part=me domain=jonwatson.ca
checking domains
search_open: lsearch "/etc/exim4/virtual.domains"
  cached open
search_find: file="/etc/exim4/virtual.domains"
  key="jonwatson.ca" partial=2 affix=*. starflags=0
LRU list:
  :/etc/exim4/virtual.domains
  End
internal_search_find: file="/etc/exim4/virtual.domains"
  type=lsearch key="jonwatson.ca"
cached data used for lookup of jonwatson.ca
  in /etc/exim4/virtual.domains
lookup yielded:
jonwatson.ca in "partial-lsearch;/etc/exim4/virtual.domains"? yes (matched "partial-lsearch;/etc/exim4/virtual.domains")
calling virtual router
rda_interpret (string): ${lookup($local_part@$domain}lsearch*@{/etc/exim4/virtual.users}}
virtual router: defer for me@jonwatson.ca
  message: failed to expand "${lookup($local_part@$domain}lsearch*@{/etc/exim4/virtual.users}}": missing lookup type
me@jonwatson.ca 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 >>>>>>>>>>>>>>>>
theheatsinkbbs:/etc/exim4#

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 virtual.domains and virtual.users files as well:

Code:

#virtual domains
theheatsinkbbs.ca
jonwatson.ca

Code:

#theheatsinkbbs.ca
heatsink@theheatsinkbbs.ca : heatsink
*@theheatsinkbbs.ca : heatsink

#jonwatson.ca
me@jonwatson.ca : heatsink
*@jonwatson.ca : heatsink

Thoughts?

Thanks!

Jon

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

Code:

theheatsinkbbs:/etc/exim4# mailq

52m  1.1K 1CBywA-0001zA-4G <xxx@xxx.com>
          me@jonwatson.ca

37m  1.1K 1CBzAr-00021g-3v <xxx@xxx.com>
          heatsink@theheatsinkbbs.ca

36m  1.1K 1CBzB3-00021h-R0 <xxx@xxx.com>
          me@jonwatson.ca

theheatsinkbbs:/etc/exim4#

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.