Main Menu
Home
Search
Support
How To's
OpenWiki
Contact Us
Users Blogs
User HowTo's
Announcements
Google Translation

 

 

 

 

Postfix aliases from the Active Directory CN PDF Print E-mail
User Rating: / 0
PoorBest 
Written by Paul Matthews   

This allows the information found in the 'mail' attribute on your Active Directory tree to be drawn down into a postfix alias formatted file.

Name: Postfix
HomePage: http://www.postfix.org/
Function: (message transfer agent) postfix is program responsible for receiving incoming e-mails and delivering the messages to individual users

Name: PAM
HomePage: http://www.kernel.org/pub/linux/libs/pam/
Function: Linux-PAM (Pluggable Authentication Modules for Linux)

 

1. Setup postfix as explained in one of my other installation guides

2. Download the following script.

cd /etc/postfix/

wget http://www.opensourcehowto.org/uploads/scripts/getadalias_pl.txt

3. Edit the file to suit your network

 

nano /etc/postfix/getadalias_pl.txt

4. Make cron run this script every 10 minutes, or whenever you want it to.

crontab -e

5. then place the following information into the file

 

crontab:
10,20,30,40,50 * * * * /etc/postfix/getadalias_pl.txt


6. Change your postfix main.cf file to look like this

 

nano /etc/postfix/main.cf

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


7.This requires Net::LDAP to be installed.  To install Net::LDAP, at a shell type

perl -MCPAN -e shell

Once Net::LDAP is installed then type

install Net::LDAP

 

8. This script searches your active directory database to returns with the sAMAccountName and mail attribute, strips out the unnecessary '@example.com' and then places them in the file that you choose when editing the script (eg: /etc/postfix/ldap-aliases.cf) in the format of postfix aliases (aliases: username). You will still need to have the users on the system that mach the users in the alias file, so I suggest you edit your pop3/imap pam module and use either the ldap client or winbind to Authenticate against Active Directory so you have the same username/password.

 


BookMarking:

 

cell1

cell3 Submit to del.icio.us
cell4
AddThis Social Bookmark Button

 


Trouble Shooting:



Go to the wiki page

Go to the 'Contact Us ' Forum

Go to the how-to's Support Forum


External Links:

 

http://www.postfix.org/

 

http://www.kernel.org/pub/linux/libs/pam/

Last Updated ( Saturday, 14 April 2007 )
 
< Prev   Next >