From 430b09144d46f5b07defe39f355496f04f6c1ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Kov=C3=A1cs?= Date: Tue, 10 Nov 2020 11:40:00 +0100 Subject: [PATCH] Roundcube admin login --- docs/third_party-roundcube.md | 59 +++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/docs/third_party-roundcube.md b/docs/third_party-roundcube.md index dd2a99b18..d079db753 100644 --- a/docs/third_party-roundcube.md +++ b/docs/third_party-roundcube.md @@ -152,3 +152,62 @@ $MAILCOW_APPS = array( ); ... ```` + +### Let admins log into Roundcube without password + +First, install plugin [dovecot_impersonate](https://github.com/corbosman/dovecot_impersonate/) and add Roundcube as an app (see above). + +Edit `mailcow.conf` and add the following: + +``` +# Allow admins to log into Roundcube as email user (without any password) +# Roundcube with plugin dovecot_impersonate must be installed first + +ALLOW_ADMIN_EMAIL_LOGIN_ROUNDCUBE=y +``` + +Edit `docker-compose.override.yml` and crate/extend the section for `php-fpm-mailcow`: + +```yml +version: '2.1' +services: + postfix-mailcow: + environment: + - ALLOW_ADMIN_EMAIL_LOGIN_ROUNDCUBE=${ALLOW_ADMIN_EMAIL_LOGIN_ROUNDCUBE:-n} +``` + + +Edit `data/web/js/site/mailbox.js` and the following code after [`if (ALLOW_ADMIN_EMAIL_LOGIN) { ... }`](https://github.com/mailcow/mailcow-dockerized/pull/3849/commits/1c873a83b5e6b1714512b2dc79ff81b26af3ef79#diff-aac7eb6ff52acc8698ff9bcc71c313cbc5bbbe501c3eb1b8bc658ef97fb9d4c1) + +```php +if (ALLOW_ADMIN_EMAIL_LOGIN_ROUNDCUBE) { + item.action += ' Roundcube'; +} +``` + +Edit `data/web/mailbox.php` and add this code to the bottom of the [javascript section](https://github.com/mailcow/mailcow-dockerized/pull/3849/commits/1c873a83b5e6b1714512b2dc79ff81b26af3ef79#diff-312fb7af69e284eca2fd573cdf2e4c3d04b6cd93fc5eb0e4dcdc6c199afd0aba): + +```php + +``` + +Copy the contents of the following files from this [Snippet](https://gitlab.com/-/snippets/2038244): + +* `data/web/inc/lib/RoundcubeAutoLogin.php` +* `data/web/rc-auth.php` + +Finally, restart mailcow + +``` +docker-compose down +docker-compose up -d +```