James Reid wrote:
> I *believe* I need to put something in local_recipient_maps in main.cf to
> point it at the ldap aliases (I think this is to stop emails for non-users
> being checked by amavisd etc???), but can't quite figure this out - can you
> give a suggestion for this?


Ok, I run multiple MX servers, each of which has it's own
amavis/spamassassin setup. They also run dbmail-lmtpd each of them,
which all connect to the same central mysql backend.

My LDAP structure looks like this:

1) each domain has it's own subtree
# domain setup
dn: mailDomain=somedomain.org,ou=mailDomains,dc=nfg,dc=nl
objectClass: top
objectClass: dbmailDomain
mailDomain: somedomain.org
mailHost: lmtp:[10.1.2.3]:24

2) pop3/imap accounts are always below a domain:
# an account
dn:
[EMAIL PROTECTED],mailDomain=somedomain.org,ou=MailDomains,dc=nfg,dc=nl
objectClass: account
objectClass: dbmailUser
objectClass: top
uidNumber: 8973
gidNumber: 100
mailHost: dbmail
uid: [EMAIL PROTECTED]
mail: [EMAIL PROTECTED]

3) same for forwarding setups
# a forward
dn:
[EMAIL PROTECTED],mailDomain=somedomain.org,ou=MailDomains,dc=nfg,dc=nl
objectClass: top
objectClass: account
objectClass: dbmailForwardingAddress
uid: [EMAIL PROTECTED]
mailForwardingAddress: [EMAIL PROTECTED]
mail: [EMAIL PROTECTED]



# in /etc/postfix/main.cf:
# add to relay_domains: ldap:/etc/postfix/ldap_relay.cf
transport_maps          = ldap:/etc/postfix/ldap_transport.cf
virtual_transport       = lmtp:[localhost]:24
virtual_mailbox_domains = ldap:/etc/postfix/ldap_virtual_domains.cf
virtual_mailbox_maps    = ldap:/etc/postfix/ldap_virtual_mailbox.cf
alias_maps              = ldap:/etc/postfix/ldap_aliases.cf

/etc/postfix/ldap_relay.cf:
server_host = ldap
bind = no
search_base = dc=nfg,dc=nl
query_filter =
(&(mailDomain=%s)(objectClass=dbmailDomain)(!(mailHost=lmtp:[dbmail]:24)))
result_attribute = mailDomain

/etc/postfix/ldap_aliases.cf:
server_host = ldap
bind = no
search_base = dc=nfg,dc=nl
query_filter = (&(objectclass=dbmailforwardingaddress)(mail=%s))
result_attribute = mailForwardingAddress

/etc/postfix/ldap_transport.cf:
server_host = ldap
bind = no
search_base = dc=nfg,dc=nl
query_filter = (&(mailDomain=%d)(objectClass=dbmailDomain))
result_attribute = mailHost
result_filter = %s

/etc/postfix/ldap_virtual_domains.cf:
server_host = ldap
bind = no
search_base = dc=nfg,dc=nl
query_filter =
(&(objectClass=dbmailDomain)(mailDomain=%s)(mailHost=lmtp:[dbmail]:24))
result_attribute = mailDomain

/etc/postfix/ldap_virtual_mailbox.cf:
server_host = ldap
bind = no
search_base = dc=nfg,dc=nl
query_filter = (mail=%s)
result_attribute = uid


I've altered some attributeTypes in dbmail.schema to allow for more
substring matching. Also, the mailHost match in ldap_virtual_domains.cf
should probably also allow for substring matching if you want to use
more than one lmtp server. Currently, I'm hard-coding the 'dbmail'
hostname in /etc/hosts to point to the lmtp daemon running on localhost.

Also, this setup allows me to specify a different transport for a domain
that is not lmtp. Some clients run their own smtp server, and we only
run backup mx.




-- 
  ________________________________________________________________
  Paul Stevens                                      paul at nfg.nl
  NET FACILITIES GROUP                     GPG/PGP: 1024D/11F8CD31
  The Netherlands________________________________http://www.nfg.nl
_______________________________________________
DBmail mailing list
[email protected]
https://mailman.fastxs.nl/mailman/listinfo/dbmail

Reply via email to