[Pkg-exim4-users] Obtaining Local Domains from a mysql database.

Alex King alex at king.net.nz
Thu Dec 7 05:23:22 CET 2006


In exim3 there was a built in distinction between local domains and 
non-local domains.  Local domains were handled by directors, while 
non-local domains were handled by  routers.

In exim 4 this distinction was removed, there is no longer a fundamental 
difference between local and non-local domains.  Both are all handled by 
routers and directors were removed.

However, it is still often a useful distinction, and the standard 
configuration files that ship with Debian create a domainlist 
(local_domains) which specify which domains are local.

If you simply want to add additional domains to local_domains, you can 
re-define that domain list by setting the MAIN_LOCAL_DOMAINS macro to 
include a mysql lookup.

The local_domains macro is used in two main roles.  It is used to 
determine which routers to run (ie, to run the equivalent of exim3 
directors for local addresses), and it is also used in ACL statements.  
ACL statements are mainly used at SMTP time to accept or reject messages 
and to prevent unauthorised use of your server (ie, so exim doesn't act 
as an open relay).

If you already have your routers sotred out, it is ACLs you need to work 
on now, particularly the  acl_check_rcpt acl.  Instead of modifying the 
local_domains macro, you could instead put a hook into this acl using 
the CHECK_RCPT_LOCAL_ACL_FILE macro.  Check it out in 
/etc/exim4/conf.d/acl/30_exim4-config_check_rcpt, and then put an actual 
macro somewhere in
/etc/exim4/conf.d/main (if you are using the split config, which you 
should do if you are doing this type of change).

You also need to read the chapter on ACLs and actually write the ACL 
fragment that will accept mail for domains based on your mysql lookup.

In setups such as yours, the local_domains macro and the concept behind 
it may not make much sense.  I sometimes create another domainlist 
called virtual_domains in such cases to handle domains defined in your 
mysql (or ldap or other) database.  I also sometimes find it difficult 
to shoehorn such setups into the Debian config system.  It is sometimes 
better to copy your current config to /etc/exim4/exim4.conf and strip it 
down and re-structure it to better fit what you want.

Cheers,

Alex


Neil Briscoe wrote:
> Currently, the way Debian-Exim4 works is that it uses the dc_other_hosts 
> entry from update-exim4.conf.conf file to determine which domains it 
> will accept mail for.
>
> I have a customer who wants me to configure things so that the domains 
> it will accept mail for are contained in a table of a mysql database.
>
> I have, therefore, installed exim4-daemon-heavy so that I have those 
> facilities.
>
> Whilst I think I can work out the code necessary for the routers (they 
> only need a modified local_delivery and a modified aliases), I'm not 
> certain how to get Exim4 to obtain its view of accepted local domains 
> from a mysql table.
>
> Yes Marc, I have read chapter 9. ;-))
>
> Regards
> Neil
>
> ------------------------------------------------------------------------------------
> Scanned for viruses, spam and offensive content by CensorNet MailSafe
>
> Professional Web & E-mail Filtering from www.censornet.com
>
> _______________________________________________
> Pkg-exim4-users mailing list
> Pkg-exim4-users at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/pkg-exim4-users
>   



More information about the Pkg-exim4-users mailing list