Patrick Tudor

Oh, Patrick! Show me how! Below we will convert vpopmail stored authentication into htpasswd files.
Method One:
/usr/lib/courier-imap/sbin/vchkpw2userdb --todir=/etc/userdb/vpopmail

/usr/lib/courier-imap/sbin/makeuserdb

cut -f1,5 -d'|' /etc/userdb/vpopmail/domains/* | sed "s/.uid=89|systempw=/:/g" > /var/www/conf/from-vchkpw.htpasswd

Method Two:
#!/usr/bin/perl

use DBI;
$dbh = DBI->connect("dbi:mysql:vpopmail:localhost","vpopmail","s00pa5ec3tp@55wd");

$yank = $dbh->prepare("select pw_name,pw_clear_passwd from vpopmail where pw_domain = 'clausetolimitdomains.com' order by pw_clear_passwd");
$yank->execute();

while (($name,$pass) = $yank->fetchrow) {
print "htpasswd -b /var/apache/conf/perl-vpop.htpasswd $name $pass\n";
}

Copyright © 2005 Patrick Tudor