Active Directory has a type of grouping called Distribution group used solely as an email distribution list. This page will show you how to use the distribution group as a mailing list for Postfix. But first, you need to upgrade Postfix to version 2.4 or higher. Download Postfix RPM Packages.
We will be using the following attributes
- mail - Email Address
- member - Distinguished Name of the group members
How to setup


server_host = your domain controller search_base = your search base version = 3 query_filter = (&(objectclass=group)(mail=%s)) leaf_result_attribute = mail special_result_attribute = member bind = yes bind_dn = user name bind_pw = password
leaf_result_attribute is available only in Postfix 2.4 and above which is why we really need to upgrade.
postmap -q topstars@acme.local ldap:/etc/postfix/ldap-groups.cf
If you are querying a Windows 2003 Server and postmap does not seem to work, try enabling the Windows 2003 Active Directory anonymous ldap operations.


virtual_alias_maps = ldap:/etc/postfix/ldap-groups.cfBut if you used Winbind and the Active Directory users are part of your system account then use this line
alias_maps = ldap:/etc/postfix/ldap-groups.cf
That’s it. You should now be able to send email to your distribution group.
Related Pages
***
Posted on 3/23/2007 and last updated on 8/25/2008
Filed under Active Directory , LDAP , Postfix
Share This






March 6th, 2008 at 11:43 pm
Thank you very much for the information on seting up a linux mail server. it was well presented and easy to understand.
My network do have a linux posfix mail server that has been setup by a consultant and this info will greatly assist me in troubleshooting this server should any problem occur.
Good on you.
May 2nd, 2008 at 8:20 pm
The new mail server is working great, but I can get the mailing list feature to work.
I followed the instructions above and postmap can query the ldap server just fine, but I run this command
postmap -vq IT@prograss.com ldap:/etc/postfix/ldap-groups.cf
I get the following results
postmap: dict_open: ldap:/etc/postfix/ldap-groups.cf
postmap: dict_ldap_lookup: In dict_ldap_lookup
postmap: dict_ldap_lookup: No existing connection for LDAP source /etc/postfix/ldap-groups.cf, reopening
postmap: dict_ldap_connect: Connecting to server ldap://adserver.prograss.local:389
postmap: dict_ldap_connect: Actual Protocol version used is 3.
postmap: dict_ldap_connect: Binding to server ldap://adserver.prograss.local:389 as dn LOCAL\Administrator
postmap: dict_ldap_connect: Successful bind to server ldap://adserver.prograss.local:389 as LOCAL\Administrator
postmap: dict_ldap_connect: Cached connection handle for LDAP source /etc/postfix/ldap-groups.cf
postmap: dict_ldap_lookup: /etc/postfix/ldap-groups.cf: Searching with filter (&(objectclass=group)(mail=it@prograss.com))
postmap: dict_ldap_get_values[1]: Search found 1 match(es)
postmap: dict_ldap_get_values[1]: looking up DN CN=ccooper,CN=Users,DC=ProGrass,DC=local
postmap: dict_ldap_get_values[2]: Search found 1 match(es)
postmap: dict_ldap_get_values[2]: Leaving dict_ldap_get_values
postmap: dict_ldap_get_values[1]: search returned 1 value(s) for special result attribute member
postmap: dict_ldap_get_values[1]: Leaving dict_ldap_get_values
postmap: dict_ldap_lookup: Search returned nothing
postmap: dict_ldap_close: Closed connection handle for LDAP source /etc/postfix/ldap-groups.cf
It appears that it can not interrupt the following line
postmap: dict_ldap_get_values[1]: looking up DN CN=ccooper,CN=Users,DC=ProGrass,DC=local
Please help
Thanks,
Cooper
May 4th, 2008 at 2:38 am
You’re right, the LDAP lookup is not working. It seems LDAP in Postfix 2.5 is broken. Please reinstall the Postfix RPMs, I’ve rebuilt the RPMs using Postfix 2.4.
May 5th, 2008 at 6:08 pm
Is there anyway to get this feature to work with postfix 2.5 or have this work with a mysql server
Cooper
May 5th, 2008 at 11:39 pm
I think Postfix 2.5 is broken, the same command works in 2.4 and even in 2.3 without the leaf_result_attribute. Mysql will also work but it will require more work since you need to setup the database schema. You’ll also lose the address book capability if you use mysql.
May 31st, 2008 at 6:21 am
False alarm, Postfix 2.5 with LDAP is working properly. I’ve restored the 2.5 RPMs.
August 22nd, 2008 at 7:15 am
sorry,
after I follow these steps. I done with LDAP query. But now I don’t know how to create mailbox on Postfix by using user on AD.
Could please someones guide me, or do you have any document about that?
Thanks a lot
August 22nd, 2008 at 1:38 pm
See Postfix, Dovecot and Active Directory
Mailbox creation is automatic, all you have to do is assign a value in the Email field of Active Directory.
August 22nd, 2008 at 4:03 pm
Thank you very much for your reply.
your link is very helpful for me!