Freeipa group expansion for postfix

26 January,2022

In order to acheive this i created a group and added an mailGroup(objectClass) and its MUST mail(attribute)

ipa group-add support ipa group-mod support --addattr="objectclass=mailGroup" --addattr=""

This will create a group with mail “”

Now add members either using CLI or WebUI

ipa group-add-member support

This will be the newly created group with its member

#support, groups, accounts,

dn: cn=support,cn=groups,cn=accounts,dc=example,dc=com cn: support objectClass: top objectClass: groupofnames objectClass: nestedgroup objectClass: ipausergroup objectClass: ipaobject objectClass: mailGroup ipaUniqueID: 58c0bc3a-7e97-11ec-ab9c-96f26bde8936 member: uid=test,cn=users,cn=accounts,dc=example,dc=com member: uid=test2,cn=users,cn=accounts,dc=example,dc=com

In postfix, create a ldap lookup table. I usually create all these ldap files in /etc/postfix/ldap

bind = yes bind_dn = uid=user,cn=users,cn=accounts,dc=example,dc=com bind_pw = secret server_host = search_base = cn=accounts,dc=example,dc=com query_filter = (&(objectClass=groupofnames)(cn=%u)) result_attribute = mail special_result_attribute = member

Use postmap command to create a local db

postmap /path/to/

Now check if this produces the desired output. The desired output would be the email addresses of all the members.

postmap -q ldap:/path/to/

The output being,