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.

Active Directory GroupThis is what an Active Directory distribution group looks like.
Active Directory GroupAnd these are the group members.
JXplorer Active Directory GroupAnd this is how it is stored in LDAP.

We will be using the following attributes

  • mail – Email Address
  • member – Distinguished Name of the group members

How to setup

1. Create the file /etc/postfix/ containing the following lines below.
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

Noteleaf_result_attribute is available only in Postfix 2.4 and above which is why we really need to upgrade.

Postmap query2. Test your postfix configuration file by typing in the command below in a terminal window.
postmap -q group@acme.local ldap:/etc/postfix/
Replace group@acme.local with your own valid group email. You should see the email addresses of the members.

NoteIf you are querying a Windows 2003 Server and postmap does not seem to work, try enabling the Windows 2003 Active Directory anonymous ldap operations.

Edit main.cf3. Edit the file /etc/postfix/ and add the line below.
virtual_alias_maps = ldap:/etc/postfix/
Service Configuration4. Restart Postfix or MailScanner (depends if you installed MailScanner).

That’s it. You should now be able to send email to your distribution group.

Related Pages

Visit the forum to ask for help or to give a comment.

Posted on 3/23/2007 and last updated on 11/7/2009
Filed under Active Directory , LDAP , Postfix