Eduardo M KALINOWSKI
2008-Jun-19 18:02 UTC
[Dovecot] Using sork-passwd from Horde to change dovecot password
I'm using in my server dovecot and Horde to provide IMAP and Webmail for virtual users. Their password are stored in a passwd file, since the setup is quite simple and small. I'd like to use the Horde module sork-passwd to allow changing of the passwords. Apparently, this can be done for the case of passwd file by using an expect script, or simply calling a program that receives the data. It should not be hard to write a Perl (or Python, or whatever) script that does that. I'm just asking if someone has already done that and is willing to share the solution.
Eduardo M KALINOWSKI
2008-Jun-21 21:57 UTC
[Dovecot] Using sork-passwd from Horde to change dovecot password
Eduardo M KALINOWSKI wrote:> I'm using in my server dovecot and Horde to provide IMAP and > Webmail for virtual users. Their password are stored in a passwd file, > since the setup is quite simple and small. I'd like to use the Horde > module sork-passwd to allow changing of the passwords. Apparently, > this can be done for the case of passwd file by using an expect > script, or simply calling a program that receives the data. > > It should not be hard to write a Perl (or Python, or whatever) > script that does that. I'm just asking if someone has already done > that and is willing to share the solution.OK, since apparently nobody needed that before, here's a quick and dirty solution. There is lots of room for improvement, but it Works For Me (and My Setup). First, this goes in the passwd's backends.php: $backends['dovecotpasswdfile'] = array( 'name' => 'localhost', 'password policy' => array(), 'driver' => 'procopen', 'params' => array( 'program' => '/usr/local/bin/chdovecotpw' ) ); The script is attached. A big problem is that I had to pass the password in the command-line, because dovecotpw seems to play tricks in order to read the input, simply writing the password twice to its STDIN does not seem to work. -- N?o deixe a escola atrapalhar seus estudos. Eduardo M KALINOWSKI eduardo at kalinowski.com.br http://move.to/hpkb -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: chdovecotpw URL: <http://dovecot.org/pipermail/dovecot/attachments/20080621/4fcf38a9/attachment-0002.pl>