FreeKB - Postfix (Email) LDAP
Postfix (Email) - LDAP

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

Create the file.

~]# touch /etc/postfix/


Add the hostname and base DN of your LDAP server to the file.

server_host =
search_base = dc=example,dc=com


Make sure you can query a LDAP user.

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


Add ldap:/etc/postfix/ to the alias_maps line in your /etc/postfix/ file.

alias_maps = hash:/etc/aliases, ldap:/etc/postfix/


The ps command can be used to determine if your system is using init or systemd. If PID 1 is init, then you will use the service command. If PID 1 is systemd, then you will use the systemctl command.

If your system is using systemd, use the systemctl command to restart postfix.

systemctl restart postfix


If your system is using init, use the service command to restart postfix.

service postfix restart


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 b7a57 in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |