<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
Aki:<br>
<br>
I have identified a bug in the "<b>-O</b>" option of "<b>doveadm
mailbox cryptokey password</b>" plugin command -- it is expecting
an argument, but it is supposed to be a boolean option. I have also
identified the (simple) fix to the source on github...<br>
<br>
<i>I am a dovecot community noob, so please forgive me if this has
already been identified... (if so, I hope it gets fixed soon)...<br>
</i><br>
The "-O" option in <b>struct doveadm_cmd_mcp_key_password</b> is
set to expect a <b>STR</b> parameter, but it should be <b>BOOL</b>.
See line 1027 in plugins/mail-crypt/doveadm-mail-crypt.c of master
branch...<br>
<br>
Currently:<br>
<b> </b><b><span class="pl-c1">DOVEADM_CMD_PARAM</span></b><b>(</b><b><span
class="pl-s"><span class="pl-pds">'</span>O<span class="pl-pds">'</span></span></b><b>,
</b><b><span class="pl-s"><span class="pl-pds">"</span>ask-old-password<span
class="pl-pds">"</span></span></b><b>, CMD_PARAM_STR, </b><b><span
class="pl-c1">0</span></b><b>)<br>
<br>
</b>Should be:<br>
<b> </b><b><span class="pl-c1">DOVEADM_CMD_PARAM</span></b><b>(</b><b><span
class="pl-s"><span class="pl-pds">'</span>O<span class="pl-pds">'</span></span></b><b>,
</b><b><span class="pl-s"><span class="pl-pds">"</span>ask-old-password<span
class="pl-pds">"</span></span></b><b>, CMD_PARAM_BOOL, </b><b><span
class="pl-c1">0</span></b><b>)</b><br>
<br>
Workaround is to specify <b>-O</b> last on command line with a
dummy argument, like this:<br>
<b>doveadm mailbox cryptokey password -N -O ""</b><br>
<br>
Also, a quick question and suggestion -- Why does the <b>doveadm
mailbox cryptokey password</b> command not ask for a new password
twice, with a check that both entries must match before the password
is changed? The last thing we would want is to type something wrong
accidentally, and change the new password to something unknown --
rendering encrypted email unrecoverable. I would like to suggest
that the code in <b>cmd_mcp_key_password_run</b> be amended to
include verifying password entry twice.<br>
<br>
(I am writing a simple addition to postfixadmin that changes the
user's mail-crypt password whenever they use postfixadmin to change
their login password. It calls <b>doveadm</b> to change the keys.
I came across this bug while working through this.)<br>
<br>
Thanks for all your help!<br>
Eric<br>
<b></b>
</body>
</html>