[Samba] winbind + Active Directory + email

gregorcy brian.gregorcy at utah.edu
Thu Oct 29 11:56:10 MDT 2009

Robert LeBlanc wrote:
> Ok, I can't seem to search for the right thing to get what I need. I'm
> looking for a solution where if quota or some other mailing system needs to
> send an email to an Active Directory user, that it uses the email address
> listed in Active Directory for that user. We are connected to Active
> Directory using winbind, on one system we are using pam_winbind, on another
> we are not. Of course, I'm looking for the simplest option. It seems that
> mail is being sent to user_at_hostname right now.
> Thanks,
> Robert LeBlanc
> Life Sciences & Undergraduate Education Computer Support
> Brigham Young University

Hi Robert,

I used the ldapsearch command in a preexec script to create a .forward, the command I used was:

> # ldapsearch -D "cn=SOMEFAKEUSERR,ou=Service,dc=domain,dc=utah,dc=edu" -b "ou=CHE_Users,dc=domain,dc=utah,dc=edu" -w PASSWORD -x -LLL "(sAMAccountName=00112413)" mail | grep mail
> # Output looks like this:
> # mail: FOOBAR at eng.utah.edu

I can send the entire script if you are interested, the above is just what handles the email.

Brian Gregorcy
IT Manager
University of Utah
Department of Chemical Engineering

More information about the samba mailing list