Re: [Dovecot] Migrating password scheme
Andreas wrote:
I tried the userdb prefetch / postlogin script method to do some password manipulation, but it doesn't appear to work for me. In particular, I don't think this method works with
userdb { driver = passwd-file args = /path/to/passwd-file userdb_pw=%w }
From what i understand you have to set a userdb_<something> variable with passdb and userdb prefetch set. The %w variable seems to be already empty (again?) at userdb stage.
Did all of that. The problem is not prefetching, but that you can't pass arguments via the args=.... Dovecot parses the entire line as a password file pathname.
Timo Sirainen definitively writes:
With v2.1 try:
userdb { driver = passwd-file args = /path/to/passwd-file default_fields = pw=%w }
Thanks, Timo. This works beautifully. Furthermore, it doesn't need the userdb prefetch. Summarizing, the minimal incantation for passing dovecot variables to the post-login script is
userdb {
driver = passwd-file
args = /var/dovecot/test/passwd
default_fields = pw=%w
}
service imap {
executable = imap postlogin
...
}
service pop3 {
executable = imap postlogin
...
}
service postlogin {
executable = script-login /path/to/postlogin-exec
# Careful -- defaults to root
user = $default_internal_user
unix_listener postlogin {
}
}
I've updated the Dovecot2 wiki, but I am unsure which userdb's "default_fields" applies to, and whether it just applies to postlogin scripts, so I documented it at
http://wiki2.dovecot.org/AuthDatabase/PasswdFile
Joseph Tam jtam.home@gmail.com
On 26.3.2013, at 5.14, Joseph Tam jtam.home@gmail.com wrote:
I've updated the Dovecot2 wiki, but I am unsure which userdb's "default_fields" applies to, and whether it just applies to postlogin scripts, so I documented it at
It works with all userdbs and passdbs. There are some other new features also generic to all passdbs. I guess the PasswordDatabase and UserDatabase pages need some sections about them.. Wonder if the common ones should be pointed to AuthDatabase or just copy&pasted (=become desynced over time) to both pages.. Could be a good feature idea for a wiki to allow importing text from some other page :)
Anyway, I'll probably move these things over unless someone happens to beat me to it. Way too busy right now though.
participants (2)
-
Joseph Tam
-
Timo Sirainen