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

Edit ldap-groups.cf
1. Create the file /etc/postfix/ldap-groups.cf 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 the below in a terminal window.
postmap -q topstars@acme.local ldap:/etc/postfix/ldap-groups.cf
Replace topstars@acme.local with a valid list address from your server. It should return 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.cf
3. Edit the file /etc/postfix/main.cf. There are two ways to configure Postfix depending on how you integrated Active Directory. If you used the virtual user solution, add this line
virtual_alias_maps = ldap:/etc/postfix/ldap-groups.cf
But 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
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

***
Posted on 3/23/2007 and last updated on 8/25/2008
Filed under Active Directory , LDAP , Postfix


Share This