How to configure Postfix to get users from LDAP

Home > Search > How-to
  by

This assumes your Linux Postfix server is already configured to query users from LDAP. If not, follow the OpenLDAP tutorial.

Create the ldap-aliases.cf file.

~]# touch /etc/postfix/ldap-aliases.cf

 

Add the hostname and base DN of your LDAP server to the ldap-aliases.cf file.

server_host = ldap.example.com
search_base = dc=example,dc=com

 

Make sure you can query a LDAP user.

~]# postmap -q JohnDoe ldap:/etc/postfix/ldap-aliases.cf

 

Add ldap:/etc/postfix/ldap-aliases.cf to the alias_maps line in your /etc/postfix/main.cf file.

alias_maps = hash:/etc/aliases, ldap:/etc/postfix/ldap-aliases.cf

 

Restart Postfix.

~]# systemctl restart postfix

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments