I have users in external database. So far - ssh, postfix, dovecot and some others - use entries with no problem.
I have Maildirs inside /home/[user] and if the homedir exists - everything is ok - sending, receiving.
If homedir does not exist Postfix/Dovecot prints error, ssh - after login results in brand new homedir made - it uses pam_mkhomedir.so entry in /etc/pam.d/[in few files].
Postfix/Dovecot - successfully use pam.d with database backend but ignores entries with pam_mkhomedir - I have read a lot of hints in which file and on what position place it.
Maybe it's a matter of nameing file /etc/pam.d/[file] ??
Just for the benefit of others who stumble upon this by googling the Dovecot issue like I just happened to: Dovecot can be made to use
pam_mkhomedir
if you set it up that way. The documentation is at http://wiki2.dovecot.org/PasswordDatabase/PAM#PAM_sessionsOn a typical Debian/Ubuntu system, you can put this in
/etc/pam.d/dovecot
:(The
mkhomedir
module is invoked insidecommon-session
)And then edit
/etc/dovecot/conf.d/auth-system.conf.ext
in the section saying:to have those
args
say:Postfix is not responsible for creating home directories. Postfix assumes that the home directories already exist when using the built-in
local
delivery agent.If you instead use Dovecot as the LDA then Dovecot also relies on the fact that the home directory exists.
With virtual users you can set the variable
lda_mailbox_autocreate = yes
so that Dovecot automatically creates the necessary directories.And as Dovecot (and Postfix) do not "log-in" a user for mail delivery, the
pam_mkhomedir
never gets triggered. PAM is only used for authentication in this case.