Re: [Exim] How to configure exim to allow non-existant domai…

Top Page
Delete this message
Reply to this message
Author: Willie Viljoen
Date:  
To: Reed, Judith, exim-users
Subject: Re: [Exim] How to configure exim to allow non-existant domain?
-- Reply posted below original message --

----- Original Message -----
From: "Reed, Judith" <jreed@???>
To: <exim-users@???>
Sent: Monday, November 17, 2003 4:59 PM
Subject: [Exim] How to configure exim to allow non-existant domain?


> This is a multi-part message in MIME format.
> --
> [ Picked text/plain from multipart/alternative ]
> Greetings. In order to solve our spam problem, we have been configuring
> all our sendmail servers to send email to:
>
>             username@???

>
> where
>
>             internal.sysdomain

>
> is defined in /etc/hosts as the IP of an existing mailserver.
>
>
>
> The admin doing this says that he has not found a way to do this with
> Exim. Can anyone confirm that this is impossible, or provide a technique
> to do it?
>
>
>
> TIA!
>
>
>
> Judith Reed
>
> jreed@???
>
> 315-453-2912 x5835
>
> "They that can give up essential liberty to obtain a little temporary
> safety deserve neither liberty nor safety."
>
> Benjamin Franklin


Hi Judith,

I hope I understand the situation correctly, the discription is abit vague,
but as I understand it, your admin is either wrong, or afraid to learn to
use Exim, or a die hard sendmail fan :)

This sounds like a stragely obfuscated way of doing a smarthost. Those are
easy to configure with Exim, by simply adding a router to the routers
configuration. The standard use for a smarthost would be to relay outgoing
mail, in that case, it would look like this:

smart_route:
driver = manualroute
transport = remote_smtp
route_list = !+local_domains smarthost.ref.example

As I understand it, you want to deliver local mail to the other servers. I
hope I am correct in this assumption. If that is the case, it can be done by
putting a router like this high up in your router list:

smart_route:
driver = manualroute
transport = remote_smtp
route_list = * smarthost.ref.example

You could also have more complex configurations where mail for different
domains should be sent to different servers, that can be done like this:

foo_route:
driver = manualroute
transport = remote_smtp
route_list = foo.com foo.smarthost.ref.example

bar_route:
driver = manualroute
transport = remote_smtp
route_list = bar.com bar.smarthost.ref.example

Or, for groups of domains:

## In main configuration area
domainlist foo_domains = foo.com : fuu.com : fuu.com
domainlist bar_domains = bar.com : foobar.com : fubar.com

## In routers area
foogroup_route:
driver = manualroute
transport = remote_smtp
route_list = +foo_domains foo-server.smarthost.ref.example

bargroup_route:
driver = manualroute
transport = remote_smtp
route_list = +bar_domains bar-server.smarthost.ref.example

These examples still use Exim's default lookup mechanism though. This first
performs a DNS query, if no DNS information exists, it uses gethostbyname();
which will also check /etc/hosts, the order of gethostbyname(); is defined
in system configurations, in most systems, this file is /etc/nsswitch.conf,
the default should be /etc/hosts first, then DNS.

If you would like to force Exim to use gethostbyname(); first, your
smarthost routers should look like this:

smart_route:
driver = manualroute
transport = remote_smtp
route_list = * smarthost.ref.example byname

Appending byname or bydns at the end of the route_list line, selects the
mechanism Exim will use to perform its lookup.

You could also eliminate /etc/hosts completely with a smarthost router like
this:

smart_route:
driver = manualroute
transport = remote_smtp
route_list = * 10.0.0.27

Here the mail is routed directly to the IP address, no lookup is needed.

There is one other intersting use you could investigate, if you would like
to list several servers for each domain, group of domain, or all domains,
this can be done as such:

smart_route:
driver = manualroute
transport = remote_smtp
route_list = * host1.int : host2.int : host3.int randomize byname

This randomly selects where to direct mail from the list of available hosts,
the hosts are resolved with gethostbyname();

You could also do:

smart_route:
driver = manualroute
transport = remote_smtp
route_list = * host1.int : host2.int : host3.int randomize bydns

Or:

smart_route:
driver = manualroute
transport = remote_smtp
route_list = * 10.0.0.2 : 10.0.0.17 : 10.0.0.55 randomize

You could also replace randomize with no-randomize (or no_randomize, can't
remember right now), this will cycle which host is used, in the order they
appear in the list.

Remember that the order of routers matter, the first router that can route a
message, will. Also, these examples are for Exim 4. Exim 3 can do this also,
but will need slightly different configuration. Check the spec.txt file that
comes with the Exim distribution you have for exact configuration of smart
hosts, and further details on the topic.

Hope this helps
Will