Doc clean up.

This commit is contained in:
Zhang Huangbin 2017-04-11 10:17:11 +08:00
parent 896c9f504f
commit eb771005af
2 changed files with 33 additions and 6 deletions

View File

@ -15,19 +15,28 @@ time to reset password to prevent mail message leak.
> * BCRYPT is recommended on BSD systems.
> * MD5 is not safe, DO NOT USE IT no matter what reasons you have.
To generate password hash for new password, please use `doveadm` command. For
example: generate a SSHA512 password hash:
To generate password hash for new password, please use `doveadm` command.
* Generate a SSHA512 password hash:
```
$ doveadm pw -s 'ssha512' -p '123456'
{SSHA512}jOcGSlKEz95VeuLGecbL0MwJKy0yWY9foj6UlUVfZ2O2SNkEExU3n42YJLXDbLnu3ghnIRBkwDMsM31q7OI0jY5B/5E=
```
* Generate a BCRYPT password hash on BSD system:
```
$ doveadm pw -s 'blf-crypt' -p '123'
{BLF-CRYPT}$2a$05$9CTW6FZtjHeK6W.2YMmzOeAj2YFvDpP4JEH0uH/YLQI81jPWDtzQW
```
### SQL backends
To reset password for user `user@domain.ltd`, please login to SQL server as
either SQL root user or `vmailadmin` user (note: sql user `vmail` has read-only
privilege to `vmail` database, so you cannot use it to change user password):
privilege to `vmail` database, so you cannot use it to change user password),
then execute SQL commands to reset password:
```
sql> USE vmail;
@ -43,6 +52,10 @@ preferred.
## Reset password with scripts shipped in iRedAdmin-Pro
!!! attention
iRedAdmin-Pro scripts support both SQL and LDAP backends.
### Reset password for one user
iRedAdmin-Pro ships script `tools/reset_user_password.py` to help you reset

View File

@ -52,16 +52,26 @@ time to reset password to prevent mail message leak.</p>
<li>MD5 is not safe, DO NOT USE IT no matter what reasons you have.</li>
</ul>
</blockquote>
<p>To generate password hash for new password, please use <code>doveadm</code> command. For
example: generate a SSHA512 password hash:</p>
<p>To generate password hash for new password, please use <code>doveadm</code> command.</p>
<ul>
<li>Generate a SSHA512 password hash:</li>
</ul>
<pre><code>$ doveadm pw -s 'ssha512' -p '123456'
{SSHA512}jOcGSlKEz95VeuLGecbL0MwJKy0yWY9foj6UlUVfZ2O2SNkEExU3n42YJLXDbLnu3ghnIRBkwDMsM31q7OI0jY5B/5E=
</code></pre>
<ul>
<li>Generate a BCRYPT password hash on BSD system:</li>
</ul>
<pre><code>$ doveadm pw -s 'blf-crypt' -p '123'
{BLF-CRYPT}$2a$05$9CTW6FZtjHeK6W.2YMmzOeAj2YFvDpP4JEH0uH/YLQI81jPWDtzQW
</code></pre>
<h3 id="sql-backends">SQL backends</h3>
<p>To reset password for user <code>user@domain.ltd</code>, please login to SQL server as
either SQL root user or <code>vmailadmin</code> user (note: sql user <code>vmail</code> has read-only
privilege to <code>vmail</code> database, so you cannot use it to change user password):</p>
privilege to <code>vmail</code> database, so you cannot use it to change user password),
then execute SQL commands to reset password:</p>
<pre><code>sql&gt; USE vmail;
sql&gt; UPDATE mailbox SET password='{SSHA512}jOcGSlKEz95VeuLGecbL0MwJKy0yWY9foj6UlUVfZ2O2SNkEExU3n42YJLXDbLnu3ghnIRBkwDMsM31q7OI0jY5B/5E=' WHERE username='user@domain.ltd';
</code></pre>
@ -72,6 +82,10 @@ LDAP client tools. <code>SSHA512</code> is recommended, but if you have some app
which needs to perform authentication with ldap dn directly, then <code>SSHA</code> is
preferred.</p>
<h2 id="reset-password-with-scripts-shipped-in-iredadmin-pro">Reset password with scripts shipped in iRedAdmin-Pro</h2>
<div class="admonition attention">
<p class="admonition-title">Attention</p>
<p>iRedAdmin-Pro scripts support both SQL and LDAP backends.</p>
</div>
<h3 id="reset-password-for-one-user">Reset password for one user</h3>
<p>iRedAdmin-Pro ships script <code>tools/reset_user_password.py</code> to help you reset
one user's password. For example, on CentOS 7 (iRedAdmin is installed under