# sasl/pam confusion



## Junaid (Feb 9, 2013)

First off *I* apologize if you feel *I* should have asked this question in a Postfix forum.

I have been trying to understand how Postfix works and so far *I* have successfully implemented 
POSTFIX
Cyrus SASL
Cyrus IMAP

All works fine and *I* can authenticate with IMAP as well as SMTPD but a few things have confused me and *I* was wondering if anyone can help clarify.

Both smtpd.conf and imapd.conf have been set up to use saslauthd, saslauthd is working with -a pam. Inside pam.d/ *I* have one imap.conf but no smtp.conf which means PAM will use others. I understand that much. But inside the file imap for instance it tells PAM to use pam_unix.so which to me should only authenticate against passwd. But all my authentications are happening against sasldb2. *H*ow does PAM know to authenticate against sasldb2?

Second IMAP uses user name only to authenticate for instance username: junaid but SMTP requires junaid@hostname. In the sasldb *I* can see the username is appeneded with the hostname like junaid@mail.example.com.

How can *I* make them both use the same username and also can *I* use domain name instead of hostname in my sasldb2 file somehow? 

Any information appreciated. Thank you


----------

