In a pathetic attempt to build a scalable, reliable mail system
consisting only of virtual accounts we decided on the following:
OpenLDAP (www.openldap.org) database backend to manage accounts
Exim (www.exim.org) MTA for routing incoming mail, sending outgoing
Courier-Imap (www.courier-mta.org) Imap Daemon for mail retrieval
In a perfect world:
LDAP structure organized as trees for each FQDN - a@??? a@???
a@??? are all different users/maildirs/accounts on the same machine
On receipt of email:
Exim queries OpenLDAP -- Does user exist? If not, reject. If so...
Exim parses address into format
Well, I keep running into a problem -- or at least what i think is a
problem.
After running the router, exim delivers messages NOT to the directory
specified in the Transport, but to the directory returned by the
router. I noticed this while testing some Courier compatibility issues
with the setup, when i tried changing the delivery destinations -- it
didn't work. ( i did restart exim -- and threw in some other changes
which took, just to test this).
Example: with the configurations below, mail goes into
/var/spool/mail/mastersofbranding.com/j/jvanasco/cur:new:tmp - not
Maildir/cur:new:tmp
Am I completely wrong about the way this behaves? Shouldn't the
"maildir" returned by the router simply make the router pass, and
actual delivery location be dictated by the transport?
}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
Sample /usr/exim/configure
{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
# ROUTERS CONFIGURATION #
begin routers
virtuals:
driver = redirect
allow_fail
allow_defer
file_transport = virtuals_maildir_delivery
domains = +local_domains
hide data = ${lookup ldap { \
user="cn=Manager,dc=redivi,dc=com" pass=secret \
ldap:///ou=Email,o=mobwire,dc=redivi,dc=com\
?maildir\
?sub\
?mobEmailAt=${quote_ldap:$local_part}\
?fqdn=${quote_ldap:$domain}\
} \
{$value} \
fail \
}
# TRANSPORTS CONFIGURATION #
begin transports
virtuals_maildir_delivery:
driver = appendfile
directory =
/var/mail/$domain/${substr_0_1:$local_part}/$local_part/Maildir
create_directory
directory_mode = 0775
delivery_date_add
envelope_to_add
return_path_add
maildir_format
group = mail
mode = 0660
}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
Sample email record .ldiff
{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
dn: mobEmailAt=jvanasco,
fqdn=mastersofbranding.com,ou=Email,o=mobwire,dc=redivi,dc=com
objectClass: MOBEmailRecord
mobEmailAt: jvanasco
mobPerson: Jonathan Vanasco
mail: jvanasco@???
maildir: /var/spool/mail/mastersofbranding.com/j/jvanasco/
mobPass: test