Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Patch for adding doveadm DIGEST-MD5 Support

2012-12-27
2013-01-23
  • Here is a quick patch to support doveadm pw + DIGEST_MD5 passwords works with dovecot + postfix.

    diff -d postfixadmin-2.3.5/config.inc.php /var/www/html/postfix/config.inc.php
    99c100
    < $CONF['encrypt'] = 'md5crypt';
    ---
    > $CONF['encrypt'] = 'dovecot:DIGEST-MD5';
    109c110
    < $CONF['dovecotpw'] = "/usr/sbin/dovecotpw";
    ---
    > $CONF['dovecotpw'] = "/usr/bin/doveadm pw";
    diff -d postfixadmin-2.3.5/create-mailbox.php /var/www/html/postfix/create-mailbox.php
    160c160
    <         $password = pacrypt ($fPassword);
    ---
    >         $password = pacrypt ($fPassword,"",$fUsername.'@'.$fDomain);
    diff -d postfixadmin-2.3.5/edit-admin.php /var/www/html/postfix/edit-admin.php
    80c80
    <                     $fPassword = pacrypt($fPassword);
    ---
    >                     $fPassword = pacrypt($fPassword,"",$username);
    diff -d postfixadmin-2.3.5/edit-mailbox.php /var/www/html/postfix/edit-mailbox.php
    110c110
    <             $formvars['password'] = pacrypt($fPassword);
    ---
    >             $formvars['password'] = pacrypt($fPassword,"",$fUsername);
    diff -d postfixadmin-2.3.5/functions.inc.php /var/www/html/postfix/functions.inc.php
    1149c1149
    < function pacrypt ($pw, $pw_db="")
    ---
    > function pacrypt ($pw, $pw_db="", $username="")
    1241,1242c1241
    <
    <         $pipe = proc_open("$dovecotpw '-s' $method", $spec, $pipes);
    ---
    >         $pipe = proc_open("$dovecotpw '-s' $method '-u' $username", $spec, $pipes);
    1267c1266,1267
    <             $password = trim(str_replace('{' . $method . '}', '', $password));
    >             $password = trim($password);
    2341c2341
    <         $password = pacrypt($fPassword);
    ---
    >         $password = pacrypt($fPassword,"",$fUsername);
    diff -d postfixadmin-2.3.5/login.php /var/www/html/postfix/login.php
    61c61
    <         $password = pacrypt ($fPassword, $row['password']);
    ---
    >         $password = pacrypt ($fPassword, $row['password'],$fUsername);
    diff -d postfixadmin-2.3.5/password.php /var/www/html/postfix/password.php
    56c56
    <         $checked_password = pacrypt ($fPassword_current, $row['password']);
    ---
    >         $checked_password = pacrypt ($fPassword_current, $row['password'], $username);
    79c79
    <         $password = pacrypt ($fPassword);
    ---
    >         $password = pacrypt ($fPassword,"",$username);