Dovecot Master User: Access user's mailbox without owner's password.

iRedMail-0.8.6 and later releases have Dovecot Master User enabled for all backends (OpenLDAP, MySQL/MariaDB, PostgreSQL) by default, what you need to do is adding new master user.

Dovecot is configured to query master user accounts from file /etc/dovecot/dovecot-master-users, you can update this file to add or remove master user.

The format is simple:

username:password

You can generate a password supported by Dovecot first. for example, SSHA512. Let's generate password hash for our password my_master_password:

# doveadm pw -s SSHA512
Enter new password: my_master_password
Retype new password: my_master_password
{SSHA512}B0VHomJaMk6aLXOPglgNgJtCUA8JRnOweAwJxRW6NPWSNZ25rG/L6T05DJXH+t8WCQkemBilgkcEi6mq4Kadssivtts=

You can now pick up any username you like, for example, my_master_user@not-exist.com. Now add new master user in file /etc/dovecot/dovecot-master-users like below:

my_master_user@not-exist.com:{SSHA512}B0VHomJaMk6aLXOPglgNgJtCU...

Now you can access user@domain.ltd's mailbox (via either IMAP or POP3 protocol) as user user@domain.ltd*my_master_user@not-exist.com with password my_master_password with Roundcube webmail (it should work with other MUAs).

WARNING:

Troubleshooting

If it doesn't work for you, please enable debug mode in Dovecot and check its log file. If you don't understand what the log says, please create a new topic in our forum and paste related log:

References