Domain aliasing
From Qmail-LDAP Wiki
Contents |
Purpose
Sometimes you may come across a situation when you should provide email services to a "domain", which is more like an alias for another domain. Typical example is:
domain.com <-> mail.domain.com .
All the users who can be reached via user@domain.com should also be reached via user@mail.domain.com
Life with Qmail-LDAP (http://www.lifewithqmail.org/ldap/#domain%20aliassing) describes a method for domain aliasing through control/virtualdomains and default forward rules. It has only one major disadvantage: you cannot use RCPTCHECK with alias domains as those are treated as non-locals. This drawback can result in a great number of unsolicited bounces.
Usage
This patch introduces a new config file: control/aliasdomains
This file is a colon-separated list of
alias_domain:real_domain
mappings. All LDAP queries on mail address are modified so that alias_domain is
replaced by real_domain.
It doesn't matter if aliasdomains file is non-existant or empty. If no match is found for the domain part of the queried mail address, it is queried unmodified.
Notes
- alias_domain must be listed in both control/rcpthosts and control/locals but need not be in control/virtualdomains or in LDAP mail addresses
- an
alias_domainmust point to areal_domain(so no multiple redirection applies) - once you have switched on domain aliasing, if you have an LDAP entry that has only "alias_domain" mail addresses, it wouldn't be found.
- of course, you can have many
alias_domains mapping to the samereal_domain
Download & Install
- You have to add
-DDOMAIN_ALIASto LDAPFLAGS in Makefile.
- You have to add
Test
You can check this functionality with qmail-ldaplookup:
# cat /var/qmail/control/aliasdomains mail.iif.hu:iif.hu # /var/qmail/bin/qmail-ldaplookup -m devnull@mail.iif.hu Searching ldap for: (&(objectClass=qmailuser)(|(mail=devnull@iif.hu)(mailAlternateAddress=devnull@iif.hu)))
- Note the difference between
iif.huandmail.iif.hu!
- Note the difference between
If properly set up, bad recipient addresses can be rejected SMTP time by using RCPTCHECK.
--Bajnokk 18:32, 7 March 2007 (CET)
