PostfixAdmin
PostfixAdmin is a web interface for Postfix used to manage mailboxes, virtual domains and aliases.
Installation
To use PostfixAdmin, you need a working Apache/MySQL/PHP setup as described in Apache HTTP Server.
For IMAP functionality, you will need to install php-imap and uncomment extension=imap
in /etc/php/php.ini
.
Next, install postfixadmin.
Configuration
Edit the PostfixAdmin configuration file:
/etc/webapps/postfixadmin/config.inc.php
$CONF['configured'] = true; // correspond to dovecot maildir path /home/vmail/%d/%u $CONF['domain_path'] = 'YES'; $CONF['domain_in_mailbox'] = 'NO'; $CONF['database_type'] = 'mysqli'; $CONF['database_host'] = 'localhost'; $CONF['database_user'] = 'postfix_user'; $CONF['database_password'] = 'hunter2'; $CONF['database_name'] = 'postfix_db'; // globally change all instances of ''change-this-to-your.domain.tld'' // to an appropriate value
If installing dovecot and you changed the password scheme in dovecot (to SHA512-CRYPT for example), reflect that with Postfix
/etc/webapps/postfixadmin/config.inc.php
$CONF['encrypt'] = 'dovecot:SHA512-CRYPT';
As of dovecot 2, dovecotpw has been deprecated. You will also want to ensure that your config reflects the new binary name.
/etc/webapps/postfixadmin/config.inc.php
$CONF['dovecotpw'] = "/usr/sbin/doveadm pw";
Create the Apache configuration file:
/etc/httpd/conf/extra/httpd-postfixadmin.conf
Alias /postfixadmin "/usr/share/webapps/postfixAdmin/public" <Directory "/usr/share/webapps/postfixAdmin/public"> DirectoryIndex index.html index.php AllowOverride All Options FollowSymlinks Require all granted </Directory>
To only allow localhost access to postfixadmin (for heightened security), add this to the previous <Directory> directive:
Order Deny,Allow Deny from all Allow from 127.0.0.1
Now, include httpd-postfixadmin.conf to /etc/httpd/conf/httpd.conf
:
# PostfixAdmin configuration Include conf/extra/httpd-postfixadmin.conf
Finally, navigate to http://127.0.0.1:80/postfixadmin/setup.php to finish the setup. Generate your setup password hash at the bottom of the page once it is done. Write the hash to the config file
/etc/webapps/postfixadmin/config.inc.php
$CONF['setup_password'] = 'yourhashhere';
Now you can create a superadmin account at http://127.0.0.1:80/postfixadmin/setup.php
/etc/webapps/postfixadmin
to the open_basedir
line in /etc/php/php.ini
.php -l /etc/webapps/postfixadmin/config.inc.php
.