Hi Paul, Thanks for your help - very much appreciated!
BUT!!! I get the following error in mailog when I try to send a message to myself: May 1 20:50:34 fs02 dbmail/lmtpd[11626]: Error:[message] dbmail-message.c,dbmail_message_store(+786): unable to find user_idnr for user [EMAIL PROTECTED]@__]. Make sure this system user is in the database! May 1 20:50:34 fs02 dbmail/lmtpd[11626]: Error:[delivery] pipe.c,insert_messages(+545): failed to store temporary message. I've traced the delivery through and can see that I've successfully authenticated. Can someone give me some suggestions on how to fix this? Thanks! James. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul J Stevens Sent: Wednesday, 30 April 2008 10:41 PM To: DBMail mailinglist Subject: Re: [Dbmail] DBMail / Postfix / LDAP / SASL2 AUTH 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=n l 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,d c=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 _______________________________________________ DBmail mailing list [email protected] https://mailman.fastxs.nl/mailman/listinfo/dbmail
