Postfixadmin & Roundcube installed from Debian Repository.
Posted: 2018-07-19 09:55
I'd just like to post (if anyone's interested) that over the last three weeks—I'm a bit slow with such things—I've been working on a new email setup on stretch.
The objective was basically to set up a Postfix-Dovecot-Letsencrypt email server, similar to the one I'd been using in jessie with Roundcube and Postfixadmin.
The reason for using this was that I couldn't get the web_interfaces which I'd used in jessie for managing postfix to work in stretch. Another problem was that Postfixadmin is apparently incompatible with the tutorial at workaround org.
So I tried the tutorial at step-by-step-setting-up-mail-server.htm except that I didn't download Postfixadmin as detailed there but rather apt installed the official Debian package and can confirm that it works fine though I had to modify it for use with the Debian package and also for Letsencrypt. (For reference, there is, by the way, another very similar tutorial at a-mailserver-on-ubuntu-16-04-postfix-dovecot-mysql/). There were, as always, quite a few stumbling blocks along the way and multiple errors in the logs which were mainly due to faulty editing on my part ; however careful you are, needles find their way into the haystack. I ran into this bug, which was easy enough to correct (with chown -R root:www-data templates_c and chown 755 templates_c). But when running the postfixadmin GUI installation setup.php I ran into
I think it's surely preferable to use the Debian official package when the directories go to the right places and are seen by apt rather than download the package from source, uncompress the directory and then chown and move it to /var/www/html/postfixadmin. But I'd be interested to hear your views on this as both methods must have their merits.
I still have to configure a few things but the new email system is finally up and running.
Update 22 July 2018]
How can Roundcube's password plugin be configured to work with Postfixadmin?
The answer is by executing these commands in mysql, which of course must be changed for your own user, database and passwords.
I found the answer in an old post from the year 2011 at lists.roundcube.net/, which I feared might not work because the syntax might've changed but I was pleasantly surprised.
Note that, in my setup, my database is called simply mail and limited to privileges GRANT, SELECT, UPDATE given to the user I named roundcube only to modify and update passwords.
Just to update the instructions given there for modifying the configuration file, which has changed a little since 2011
I modified, in /etc/roundcube/plugins/password/config.inc.php, the 'password_db_dsn' line at about line 81 like this:
& I modified the 'password_query' further down at line 106 like this, exactly as stated in the referenced link.
So one gets all the advantages detailed at postfixadmin.sourceforge.net which is thus compatible with the password plugin available in Roundcube. Not to mention the advantages of using the official, stable Debian packages.
Thanks for reading.
The objective was basically to set up a Postfix-Dovecot-Letsencrypt email server, similar to the one I'd been using in jessie with Roundcube and Postfixadmin.
The reason for using this was that I couldn't get the web_interfaces which I'd used in jessie for managing postfix to work in stretch. Another problem was that Postfixadmin is apparently incompatible with the tutorial at workaround org.
So I tried the tutorial at step-by-step-setting-up-mail-server.htm except that I didn't download Postfixadmin as detailed there but rather apt installed the official Debian package and can confirm that it works fine though I had to modify it for use with the Debian package and also for Letsencrypt. (For reference, there is, by the way, another very similar tutorial at a-mailserver-on-ubuntu-16-04-postfix-dovecot-mysql/). There were, as always, quite a few stumbling blocks along the way and multiple errors in the logs which were mainly due to faulty editing on my part ; however careful you are, needles find their way into the haystack. I ran into this bug, which was easy enough to correct (with chown -R root:www-data templates_c and chown 755 templates_c). But when running the postfixadmin GUI installation setup.php I ran into
This I was able to resolve by reinstalling the mail database in mysql with:Invalid query: Specified key was too long; max key length is 1000 bytes.
Code: Select all
SET GLOBAL default_storage_engine = 'InnoDB';
CREATE DATABASE mail CHARACTER SET utf8 COLLATE utf8_bin;
GRANT ALL PRIVILEGES ON mail.* TO 'postfixadmin'@'localhost' IDENTIFIED BY 'somelongpassword';
FLUSH PRIVILEGES;
mysql> QUIT
I still have to configure a few things but the new email system is finally up and running.
Update 22 July 2018]
How can Roundcube's password plugin be configured to work with Postfixadmin?
The answer is by executing these commands in mysql, which of course must be changed for your own user, database and passwords.
I found the answer in an old post from the year 2011 at lists.roundcube.net/, which I feared might not work because the syntax might've changed but I was pleasantly surprised.
Note that, in my setup, my database is called simply mail and limited to privileges GRANT, SELECT, UPDATE given to the user I named roundcube only to modify and update passwords.
Code: Select all
MariaDB [(none)]> GRANT SELECT, UPDATE (password, modified) ON mail.mailbox TO 'roundcube'@'localhost' IDENTIFIED BY 'Someverylong&complicatedPassword';
FLUSH PRIVILEGES;
I modified, in /etc/roundcube/plugins/password/config.inc.php, the 'password_db_dsn' line at about line 81 like this:
Code: Select all
$config['password_db_dsn'] = 'mysql://roundcube:Someverylong&complicatedpassword@localhost/mail';
Code: Select all
$config['password_query'] = "UPDATE `mailbox` SET `password` = %c, modified=now() WHERE `username` = %u LIMIT 1";
Thanks for reading.