[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Configuring Exim for mail delivery



On Sat, Oct 01, 2016 at 12:36:10PM +0200, mo wrote:
> 
> Did you follow a specific book or guide?

Google "debian exim4 configuration". And look at the upstream 
documentation in package exim4-doc-html.

> 
> >Exim configuration has the concept of "routers" and "transports".
> >Routers basically decide what to do with a message, and transports do
> >it. One of the routers configured by default in the Debian exim
> >configuration is for "hubbed hosts". What this means, is machines
> >capable of sending and receiving email ("hosts" in exim speak) that are
> >on the same LAN as this machine (connected by a "hub"). Note that this
> >"hub" could be your local home network router, and for these purposes
> >machines on WiFi and machines on a wired LAN would be considered on the
> >same hub, even though that isn't strictly true. The point is that
> >network packets can be addressed directly between the machines, they
> >don't require a router in between.
> >
> 
> As far as i do understand this is that only machines which are defined as
> hubbed hosts can be send mail in the local LAN? Or am i misunderstanding
> something here? :)
> 

In essence yes you are right, because a local configuration of exim4 
would determine that the addresses are not local and not in 
hubbed_hosts, and tell you to eff off, while a smarthost configuration 
would attempt to use the smarthost to send to the local machine, which 
is doomed to failure, and the internet configuration would attempt to 
use DNS to find the local machine, which is also doomed to failure. 
Being in hubbed_hosts prevents exim4 for going looking for an MX record 
for the receiving host, which is guaranteed to fail for a machine that 
isn't registered to the world at large as an email server.

> >In Debian, this is achieved with Avahi. This is what allows you, if you
> >have MachineA and MachineB on your network, to do for example "ping
> >MachineA.local" from MachineB and expect MachineA.local to be resolved
> >into an IP address.
> >
> 
> I'm not a friend of avahi to be honest, i much rather ignore it :D

All I can do here is echo Brian. But also, even if you aren't its 
friend, ignoring it is fine, because it comes already configured and 
will just do its job whether it gets any love from you or not. I just 
assumed you'd like to know what is going on under the hood.

> 
> >In /etc/exim4, create a file owned by root called hubbed_hosts. In the
> >file, each line maps a "domain" (the part after the @ sign in an email
> >address) to a "host" (the name of a machine on your network, as it can
> >be reached from this machine). Put the domain first, then a tab
> >character (spaces may also be OK) and then the host. So for example I
> >have a machine on my network called affinity, and so in the hubbed_hosts
> >file on the machine I am sitting in front of now, I have two lines, one
> >saying "affinity.local<TAB>affinity.local", and the other saying
> >"affinity<TAB>affinity.local" (no quotes in the file). This tells the
> >local exim installation that any email address with @affinity.local as
> >the domain should be forwarded on to a machine called affinity.local,
> >and any mail with @affinity as the domain should be forwarded on to a
> >machine called affinity.local. Exim4 will then say "Connect to
> >affinity.local!" with no attempt to translate that into an IP address,
> >and Avahi daemon will answer "that is IP address WW.XX.YY.ZZ!" to which
> >exim will say "very well, connect to WW.XX.YY.ZZ!" and the exim4 on
> >affinity will wake up and co-operate to deliver the mail.
> 
> I just did that and now mailing works flawlessly :D
> Just one questions: Why do i need hubbed_host entries? Should it not be fine
> alone to make a entry in /etc/hosts for the machines i want to send mail to
> (I do not operate a dedicated DNS server).
> This is something i dont really understand...

hubbed_host entries apply only to exim4. I also suspect, but am not 
sure, that they are a Debian extension to exim4 in the sense that the 
*DEBIAN* exim4 comes configured for them out of the box, while the 
upstream exim4 does not. IIRC there is no reference to hubbed_hosts in 
the upstream documentation, only in the Debian docs.

They work because the debian config contains a router to handle hubbed 
hosts. You can see what it is doing if you search 
/var/lib/exim4/config.autogenerated for the text hubbed_hosts.

If the file is not populated this router is skipped and then exim4 
requires either that the address is the local machine, or that there is 
a smarthost configured that it can delegate to, or that it can find an 
official MX entry for the target domain by doing a DNS lookup. All of 
which will fail for a local box that isn't registered to the world as a 
mail server.

Mark


Reply to: