Addition/Install.PostfixAdmin.For.MySQL.Backend

From iRedMail

(Difference between revisions)
Jump to: navigation, search
(Download and configure PostfixAdmin)
(Add missing SQL tables in database 'vmail')
 
(19 intermediate revisions not shown)
Line 1: Line 1:
-
iRedMail-0.7.0 removed PostfixAdmin, but you can install it to work with MySQL backend manually.
+
__TOC__
 +
 
 +
= Summary =
 +
iRedMail doesn't ship PostfixAdmin since iRedMail-0.7.0, but the core columns in iRedMail SQL structure are almost same as PostfixAdmin, so you can install PostfixAdmin manually for MySQL backend to manage mail accounts.
 +
 
 +
'''References:'''
 +
* [http://www.iredmail.org/forum/topic1735-why-we-remove-postfixadmin-in-iredmail070.html Why we remove PostfixAdmin in iRedMail]
 +
* [http://www.iredmail.org/iredadmin-pro-mysql-vs-postfixadmin.html Compare iRedAdmin-Pro-MySQL with PostfixAdmin]
 +
 
 +
 
 +
'''Note:'''
 +
* There's no guarantee to keep iRedMail compatible with PostfixAdmin SQL structure in the future.
 +
* This tutorial is wrote for iRedMail-0.7.0, it probably need some adjustments for later versions.
 +
 
 +
= Add missing SQL tables in database 'vmail'=
 +
 
 +
Please add below SQL tables in database '''vmail''' for PostfixAdmin:
 +
{{cmd|<pre>
 +
CREATE TABLE IF NOT EXISTS log (
 +
    TIMESTAMP DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
 +
    username VARCHAR(255) NOT NULL DEFAULT '',
 +
    domain VARCHAR(255) NOT NULL DEFAULT '',
 +
    action VARCHAR(255) NOT NULL DEFAULT '',
 +
    data VARCHAR(255) NOT NULL DEFAULT '',
 +
    KEY TIMESTAMP (TIMESTAMP)
 +
) ENGINE=MyISAM;
 +
 
 +
CREATE TABLE IF NOT EXISTS vacation (
 +
    email VARCHAR(255) NOT NULL DEFAULT '',
 +
    subject VARCHAR(255) NOT NULL DEFAULT '',
 +
    body TEXT NOT NULL,
 +
    cache TEXT NOT NULL,
 +
    domain VARCHAR(255) NOT NULL DEFAULT '',
 +
    created DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
 +
    modified DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
 +
    active TINYINT(4) NOT NULL DEFAULT '1',
 +
    PRIMARY KEY (email),
 +
    KEY email (email)
 +
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
 +
 +
CREATE TABLE IF NOT EXISTS vacation_notification (
 +
    on_vacation VARCHAR(255) NOT NULL,
 +
    notified VARCHAR(255) NOT NULL,
 +
    notified_at TIMESTAMP NOT NULL DEFAULT now(),
 +
    CONSTRAINT vacation_notification_pkey PRIMARY KEY(on_vacation, notified),
 +
    FOREIGN KEY (on_vacation) REFERENCES vacation(email) ON DELETE CASCADE
 +
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
 +
</pre>}}
 +
 
 +
=Download and uncompress PostfixAdmin =
 +
* You can download PostfixAdmin from official site here: http://sourceforge.net/projects/postfixadmin/files/ , we use PostfixAdmin-2.3.2 for example: postfixadmin-2.3.2.tar.gz, and we assume you already download it under '''/root/''' directory.
 +
* Uncompress PostfixAdmin to Apache server root and set correct file permission:
-
=Download and configure PostfixAdmin =
 
{{cmd|<pre>
{{cmd|<pre>
#
#
# ---- On RHEL/CentOS ----
# ---- On RHEL/CentOS ----
-
cd /var/www
+
#
-
wget  http://www.iredmail.org/yum/misc/postfixadmin-2.3.2.tar.gz
+
# tar zxf /root/postfixadmin-2.3.2.tar.gz -C /var/www/        # <- Uncomress source tarball.
-
tar zxvf postfixadmin-2.3.2.tar.gz
+
# cd /var/www/
-
ln -s postfixadmin-2.3.2 postfixadmin
+
# ln -s postfixadmin-2.3.2 postfixadmin        # <- Create a symbol link.
-
chown -R root:root postfixadmin
+
# chown -R root:root postfixadmin        # <- Set correct owner and permission.
-
chmod -R 755 postfixadmin
+
# chmod -R 755 postfixadmin
-
cd postfixadmin
+
# cd postfixadmin
-
wget http://code.google.com/p/iredmail/source/browse/iRedMail/patches/postfixadmin/create_mailbox.patch
+
# mv setup.php setup.php.save
-
patch -p0 < create_mailbox.patch
+
# echo '' > motd.txt
-
mv setup.php setup.save
+
# echo '' > motd-users.txt
-
echo '' > motd.txt
+
 
-
echo '' > motd-users.txt
+
#
 +
# ---- On Debian/Ubuntu ----
 +
#
 +
# tar zxf /root/postfixadmin-2.3.2.tar.gz -C /usr/share/apache2/        # <- Uncomress source tarball.
 +
# cd /usr/share/apache2/
 +
# ln -s postfixadmin-2.3.2 postfixadmin        # <- Create a symbol link.
 +
# chown -R root:root postfixadmin        # <- Set correct owner and permission.
 +
# chmod -R 755 postfixadmin
 +
# cd postfixadmin
 +
# mv setup.php setup.php.save
 +
# echo '' > motd.txt
 +
# echo '' > motd-users.txt
 +
 
 +
#
 +
# ---- On OpenSuSE ----
 +
#
 +
# tar zxf /root/postfixadmin-2.3.2.tar.gz -C /srv/www/        # <- Uncomress source tarball.
 +
# cd /srv/www/
 +
# ln -s postfixadmin-2.3.2 postfixadmin       # <- Create a symbol link.
 +
# chown -R root:root postfixadmin       # <- Set correct owner and permission.
 +
# chmod -R 0755 postfixadmin
 +
# cd postfixadmin
 +
# mv setup.php setup.php.save
 +
# echo '' > motd.txt
 +
# echo '' > motd-users.txt
 +
 
 +
#
 +
# ---- On FreeBSD ----
 +
#
 +
# tar zxf /root/postfixadmin-2.3.2.tar.gz -C /usr/local/www/        # <- Uncomress source tarball.
 +
# cd /usr/local/www/
 +
# ln -s postfixadmin-2.3.2 postfixadmin        # <- Create a symbol link.
 +
# chown -R root:wheel postfixadmin        # <- Set correct owner and permission.
 +
# chmod -R 0755 postfixadmin
 +
# cd postfixadmin
 +
# mv setup.php setup.php.save
 +
# echo '' > motd.txt
 +
# echo '' > motd-users.txt
</pre>}}
</pre>}}
-
Create config.local.php file:
+
PostfixAdmin will send a welcome message to newly created mail users, but it will be failed since iRedMail requires sender login. Here's a patch to disable welcome message:
-
{{cfg|/var/www/postfixadmin/config.local.php|<pre>
+
* http://iredmail.googlecode.com/hg/tags/0.6.1/patches/postfixadmin/create_mailbox.patch
 +
 
 +
= Configure PostfixAdmin =
 +
PostfixAdmin will read custom settings from config file '''"config.local.php"''' by default, it's great for upgrading in the futher. So we will create it under postfixadmin directory.
 +
 
 +
'''NOTE:''':
 +
* You can find password of MySQL user '''"vmailadmin"''' in iRedMail installation directory, e.g. /root/iRedMail-0.7.0/iRedMail.tips.
 +
* If you choose to install iRedAdmin open source edition during iRedMail installation, you can find password of MySQL user '''"vmailadmin"''' in iRedAdmin config file:  
 +
** on RHEL/CentOS: /var/www/iredadmin/ssettings.ini
 +
** on Debian/Ubuntu: /usr/share/apache2/iredadmin/settings.ini
 +
** on openSUSE: /srv/www/iredadmin/settings.ini
 +
** on FreeBSD: /usr/local/www/iredadmin/settings.ini
 +
 
 +
{{cfg|config.local.php|<pre>
<?php
<?php
 +
// Basic configuration.
$CONF['configured'] = true;
$CONF['configured'] = true;
$CONF['postfix_admin_url'] = "/postfixadmin";
$CONF['postfix_admin_url'] = "/postfixadmin";
-
 
$CONF['default_language'] = "en";
$CONF['default_language'] = "en";
$CONF['database_type'] = "mysqli";
$CONF['database_type'] = "mysqli";
$CONF['database_host'] = "localhost";
$CONF['database_host'] = "localhost";
$CONF['database_user'] = "vmailadmin";
$CONF['database_user'] = "vmailadmin";
-
$CONF['database_password'] = "SoElbUfarkAAzYXQVHNbNkaE9h5oY4";
+
$CONF['database_password'] = "SoElbUfarkAAzYXQVHNbNkaE9h5oY4";                     # <- REPLACE THIS PASSWORD.
$CONF['database_name'] = "vmail";
$CONF['database_name'] = "vmail";
$CONF['smtp_server'] = "127.0.0.1";
$CONF['smtp_server'] = "127.0.0.1";
Line 41: Line 141:
$CONF['transport_default'] = "dovecot";
$CONF['transport_default'] = "dovecot";
-
# Enable alias domain.
+
// Enable alias domain.
$CONF['alias_domain'] = 'YES';
$CONF['alias_domain'] = 'YES';
 +
// Disable features we don't have.
$CONF['backup'] = "NO";
$CONF['backup'] = "NO";
$CONF['fetchmail'] = "NO";
$CONF['fetchmail'] = "NO";
Line 50: Line 151:
$CONF['emailcheck_resolve_domain'] = "NO";
$CONF['emailcheck_resolve_domain'] = "NO";
-
# Disable vacation.
+
// Disable PostfixAdmin style vacation. We use managesieve service instead.
$CONF['vacation_control'] = "NO";
$CONF['vacation_control'] = "NO";
$CONF['vacation_control_admin'] = "NO";
$CONF['vacation_control_admin'] = "NO";
Line 57: Line 158:
</pre>}}
</pre>}}
-
=Make PostfixAdmin can be accessed via HTTPS only=
+
= Configure Apache web server =
 +
We need to make PostfixAdmin accessable in your web browser. For security reason, we enable HTTPS only for PostfixAdmin.
-
Create PostfixAdmin Apache config file:
+
* On RHEL/CentOS, we need to create a new file: '''"/etc/httpd/conf.d/postfixadmin.conf"''', and modify '''"/etc/httpd/conf.d/ssl.conf"''' (Add one line):
{{cfg|/etc/httpd/conf.d/postfixadmin.conf|<pre>
{{cfg|/etc/httpd/conf.d/postfixadmin.conf|<pre>
<Directory "/var/www/postfixadmin/">
<Directory "/var/www/postfixadmin/">
Line 66: Line 168:
</pre>}}
</pre>}}
-
Setting SSL access. Add the line
 
{{cfg|/etc/httpd/conf.d/ssl.conf|<pre>
{{cfg|/etc/httpd/conf.d/ssl.conf|<pre>
 +
# Add below lines before </VirtualHost>
Alias /postfixadmin "/var/www/postfixadmin/"
Alias /postfixadmin "/var/www/postfixadmin/"
</pre>}}
</pre>}}
 +
 +
* On Debian/Ubuntu, we need to create a new file '''"/etc/apache2/conf.d/postfixadmin.conf"''', and modify '''"/etc/apache2/sites-enabled/default-ssl"''' (Add one line):
 +
{{cfg|/etc/apache2/conf.d/postfixadmin.conf|<pre>
 +
<Directory "/usr/share/apache2/postfixadmin/">
 +
    Options -Indexes
 +
</Directory>
 +
</pre>}}
 +
 +
{{cfg|/etc/apache2/sites-enabled/default-ssl|<pre>
 +
# Add below lines before </VirtualHost>
 +
Alias /postfixadmin "/usr/share/apache2/postfixadmin/"
 +
</pre>}}
 +
 +
 +
* On openSUSE, we need to create a new file '''"/etc/apache2/conf.d/postfixadmin.conf"''', and modify '''"/etc/apache2/vhosts.d/vhost-ssl.conf"''' (Add one line):
 +
{{cfg|/etc/apache2/conf.d/postfixadmin.conf|<pre>
 +
<Directory "/srv/www/postfixadmin/">
 +
    Options -Indexes
 +
</Directory>
 +
</pre>}}
 +
 +
{{cfg|/etc/apache2/vhosts.d/vhost-ssl.conf|<pre>
 +
# Add below lines before </VirtualHost>
 +
Alias /postfixadmin "/srv/www/postfixadmin/"
 +
</pre>}}
 +
 +
* On FreeBSD, we need to create a new file '''"/usr/local/etc/apache22/Includes/postfixadmin.conf"''', and modify '''"/usr/local/etc/apache22/Includes/extra/httpd-ssl.conf"''' (Add one line):
 +
{{cfg|/usr/local/etc/apache22/Includes/postfixadmin.conf|<pre>
 +
<Directory "/usr/local/www/postfixadmin/">
 +
    Options -Indexes
 +
</Directory>
 +
</pre>}}
 +
 +
{{cfg|/usr/local/etc/apache22/Includes/extra/httpd-ssl.conf|<pre>
 +
# Add below lines before </VirtualHost>
 +
Alias /postfixadmin "/usr/local/www/postfixadmin/"
 +
</pre>}}
 +
 +
= Restart Apache web server to make it work =
 +
 +
* On RHEL/CentOS:
 +
{{cmd|<pre># /etc/init.d/httpd restart</pre>}}
 +
 +
* On Debian/Ubuntu/openSUSE:
 +
{{cmd|<pre># /etc/init.d/apache2 restart</pre>}}
 +
 +
* On FreeBSD:
 +
{{cmd|<pre># /usr/local/etc/rc.d/apache22 restart</pre>}}
 +
 +
 +
Now you can access PostfixAdmin in web browser with URL: httpS://your_server_hostname_or_IP/postfixadmin/
 +
 +
= Important Notes =
 +
 +
* Default SQL structure in iRedMail-0.7.0 are slightly changed. In '''"vmail.mailbox"''', transport is set to '' (empty, not a SPACE character) by default, like below:
 +
<pre>
 +
CREATE TABLE IF NOT EXISTS mailbox (
 +
    [...]
 +
    transport VARCHAR(255) NOT NULL DEFAULT '',
 +
    [...]
 +
</pre>
 +
 +
You can simply change postfix lookup file '''"/etc/postfix/mysql/transport_maps_user.cf"''', append '''"AND transport<>''"''' in '''"query"''' setting.
 +
 +
In iRedMail-0.7.0, it's set to:
 +
{{cfg|/etc/postfix/mysql/transport_maps_user.cf|<pre>
 +
query      = SELECT mailbox.transport FROM mailbox,domain WHERE mailbox.username='%s' AND mailbox.domain='%d' AND mailbox.domain=domain.domain AND mailbox.transport<>'' AND mailbox.active=1 AND mailbox.enabledeliver=1 AND domain.backupmx=0 AND domain.active=1
 +
</pre>}}
 +
 +
* [http://code.google.com/p/iredmail/source/detail?r=a9393e05a12acfcc67d04a13eaacc3a5bc51a4ab iRedMail removed 3 tables: log, vacation, vacation_notification.]

Current revision as of 16:42, 15 April 2012

Contents


Summary

iRedMail doesn't ship PostfixAdmin since iRedMail-0.7.0, but the core columns in iRedMail SQL structure are almost same as PostfixAdmin, so you can install PostfixAdmin manually for MySQL backend to manage mail accounts.

References:


Note:

  • There's no guarantee to keep iRedMail compatible with PostfixAdmin SQL structure in the future.
  • This tutorial is wrote for iRedMail-0.7.0, it probably need some adjustments for later versions.

Add missing SQL tables in database 'vmail'

Please add below SQL tables in database vmail for PostfixAdmin:

Terminal:
CREATE TABLE IF NOT EXISTS log (
    TIMESTAMP DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
    username VARCHAR(255) NOT NULL DEFAULT '',
    domain VARCHAR(255) NOT NULL DEFAULT '',
    action VARCHAR(255) NOT NULL DEFAULT '',
    data VARCHAR(255) NOT NULL DEFAULT '',
    KEY TIMESTAMP (TIMESTAMP)
) ENGINE=MyISAM;

CREATE TABLE IF NOT EXISTS vacation (
    email VARCHAR(255) NOT NULL DEFAULT '',
    subject VARCHAR(255) NOT NULL DEFAULT '',
    body TEXT NOT NULL,
    cache TEXT NOT NULL,
    domain VARCHAR(255) NOT NULL DEFAULT '',
    created DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
    modified DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
    active TINYINT(4) NOT NULL DEFAULT '1',
    PRIMARY KEY (email),
    KEY email (email)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
 
CREATE TABLE IF NOT EXISTS vacation_notification (
    on_vacation VARCHAR(255) NOT NULL,
    notified VARCHAR(255) NOT NULL,
    notified_at TIMESTAMP NOT NULL DEFAULT now(),
    CONSTRAINT vacation_notification_pkey PRIMARY KEY(on_vacation, notified),
    FOREIGN KEY (on_vacation) REFERENCES vacation(email) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

Download and uncompress PostfixAdmin

  • You can download PostfixAdmin from official site here: http://sourceforge.net/projects/postfixadmin/files/ , we use PostfixAdmin-2.3.2 for example: postfixadmin-2.3.2.tar.gz, and we assume you already download it under /root/ directory.
  • Uncompress PostfixAdmin to Apache server root and set correct file permission:
Terminal:
#
# ---- On RHEL/CentOS ----
#
# tar zxf /root/postfixadmin-2.3.2.tar.gz -C /var/www/        # <- Uncomress source tarball.
# cd /var/www/
# ln -s postfixadmin-2.3.2 postfixadmin        # <- Create a symbol link.
# chown -R root:root postfixadmin        # <- Set correct owner and permission.
# chmod -R 755 postfixadmin
# cd postfixadmin
# mv setup.php setup.php.save
# echo '' > motd.txt
# echo '' > motd-users.txt

#
# ---- On Debian/Ubuntu ----
#
# tar zxf /root/postfixadmin-2.3.2.tar.gz -C /usr/share/apache2/        # <- Uncomress source tarball.
# cd /usr/share/apache2/
# ln -s postfixadmin-2.3.2 postfixadmin        # <- Create a symbol link.
# chown -R root:root postfixadmin        # <- Set correct owner and permission.
# chmod -R 755 postfixadmin
# cd postfixadmin
# mv setup.php setup.php.save
# echo '' > motd.txt
# echo '' > motd-users.txt

#
# ---- On OpenSuSE ----
#
# tar zxf /root/postfixadmin-2.3.2.tar.gz -C /srv/www/        # <- Uncomress source tarball.
# cd /srv/www/
# ln -s postfixadmin-2.3.2 postfixadmin        # <- Create a symbol link.
# chown -R root:root postfixadmin        # <- Set correct owner and permission.
# chmod -R 0755 postfixadmin
# cd postfixadmin
# mv setup.php setup.php.save
# echo '' > motd.txt
# echo '' > motd-users.txt

#
# ---- On FreeBSD ----
#
# tar zxf /root/postfixadmin-2.3.2.tar.gz -C /usr/local/www/        # <- Uncomress source tarball.
# cd /usr/local/www/
# ln -s postfixadmin-2.3.2 postfixadmin        # <- Create a symbol link.
# chown -R root:wheel postfixadmin        # <- Set correct owner and permission.
# chmod -R 0755 postfixadmin
# cd postfixadmin
# mv setup.php setup.php.save
# echo '' > motd.txt
# echo '' > motd-users.txt

PostfixAdmin will send a welcome message to newly created mail users, but it will be failed since iRedMail requires sender login. Here's a patch to disable welcome message:

Configure PostfixAdmin

PostfixAdmin will read custom settings from config file "config.local.php" by default, it's great for upgrading in the futher. So we will create it under postfixadmin directory.

NOTE::

  • You can find password of MySQL user "vmailadmin" in iRedMail installation directory, e.g. /root/iRedMail-0.7.0/iRedMail.tips.
  • If you choose to install iRedAdmin open source edition during iRedMail installation, you can find password of MySQL user "vmailadmin" in iRedAdmin config file:
    • on RHEL/CentOS: /var/www/iredadmin/ssettings.ini
    • on Debian/Ubuntu: /usr/share/apache2/iredadmin/settings.ini
    • on openSUSE: /srv/www/iredadmin/settings.ini
    • on FreeBSD: /usr/local/www/iredadmin/settings.ini
File: config.local.php
<?php
// Basic configuration.
$CONF['configured'] = true;
$CONF['postfix_admin_url'] = "/postfixadmin";
$CONF['default_language'] = "en";
$CONF['database_type'] = "mysqli";
$CONF['database_host'] = "localhost";
$CONF['database_user'] = "vmailadmin";
$CONF['database_password'] = "SoElbUfarkAAzYXQVHNbNkaE9h5oY4";                      # <- REPLACE THIS PASSWORD.
$CONF['database_name'] = "vmail";
$CONF['smtp_server'] = "127.0.0.1";

$CONF['domain_path'] = "YES";
$CONF['domain_in_mailbox'] = "NO";
$CONF['quota'] = "YES";
$CONF['quota_multiplier'] = 1;
$CONF['transport'] = "YES";
$CONF['transport_options'] = array ('dovecot', 'virtual', 'local', 'relay');
$CONF['transport_default'] = "dovecot";

// Enable alias domain.
$CONF['alias_domain'] = 'YES';

// Disable features we don't have.
$CONF['backup'] = "NO";
$CONF['fetchmail'] = "NO";
$CONF['sendmail'] = "NO";
$CONF['show_footer_text'] = "NO";
$CONF['emailcheck_resolve_domain'] = "NO";

// Disable PostfixAdmin style vacation. We use managesieve service instead.
$CONF['vacation_control'] = "NO";
$CONF['vacation_control_admin'] = "NO";
$CONF['admin_email'] = "www@example.com";
?>

Configure Apache web server

We need to make PostfixAdmin accessable in your web browser. For security reason, we enable HTTPS only for PostfixAdmin.

  • On RHEL/CentOS, we need to create a new file: "/etc/httpd/conf.d/postfixadmin.conf", and modify "/etc/httpd/conf.d/ssl.conf" (Add one line):
File: /etc/httpd/conf.d/postfixadmin.conf
<Directory "/var/www/postfixadmin/">
    Options -Indexes
</Directory>
File: /etc/httpd/conf.d/ssl.conf
# Add below lines before </VirtualHost>
Alias /postfixadmin "/var/www/postfixadmin/"
  • On Debian/Ubuntu, we need to create a new file "/etc/apache2/conf.d/postfixadmin.conf", and modify "/etc/apache2/sites-enabled/default-ssl" (Add one line):
File: /etc/apache2/conf.d/postfixadmin.conf
<Directory "/usr/share/apache2/postfixadmin/">
    Options -Indexes
</Directory>
File: /etc/apache2/sites-enabled/default-ssl
# Add below lines before </VirtualHost>
Alias /postfixadmin "/usr/share/apache2/postfixadmin/"


  • On openSUSE, we need to create a new file "/etc/apache2/conf.d/postfixadmin.conf", and modify "/etc/apache2/vhosts.d/vhost-ssl.conf" (Add one line):
File: /etc/apache2/conf.d/postfixadmin.conf
<Directory "/srv/www/postfixadmin/">
    Options -Indexes
</Directory>
File: /etc/apache2/vhosts.d/vhost-ssl.conf
# Add below lines before </VirtualHost>
Alias /postfixadmin "/srv/www/postfixadmin/"
  • On FreeBSD, we need to create a new file "/usr/local/etc/apache22/Includes/postfixadmin.conf", and modify "/usr/local/etc/apache22/Includes/extra/httpd-ssl.conf" (Add one line):
File: /usr/local/etc/apache22/Includes/postfixadmin.conf
<Directory "/usr/local/www/postfixadmin/">
    Options -Indexes
</Directory>
File: /usr/local/etc/apache22/Includes/extra/httpd-ssl.conf
# Add below lines before </VirtualHost>
Alias /postfixadmin "/usr/local/www/postfixadmin/"

Restart Apache web server to make it work

  • On RHEL/CentOS:
Terminal:
# /etc/init.d/httpd restart
  • On Debian/Ubuntu/openSUSE:
Terminal:
# /etc/init.d/apache2 restart
  • On FreeBSD:
Terminal:
# /usr/local/etc/rc.d/apache22 restart


Now you can access PostfixAdmin in web browser with URL: httpS://your_server_hostname_or_IP/postfixadmin/

Important Notes

  • Default SQL structure in iRedMail-0.7.0 are slightly changed. In "vmail.mailbox", transport is set to (empty, not a SPACE character) by default, like below:
CREATE TABLE IF NOT EXISTS mailbox (
    [...]
    transport VARCHAR(255) NOT NULL DEFAULT '',
    [...]

You can simply change postfix lookup file "/etc/postfix/mysql/transport_maps_user.cf", append "AND transport<>" in "query" setting.

In iRedMail-0.7.0, it's set to:

File: /etc/postfix/mysql/transport_maps_user.cf
query       = SELECT mailbox.transport FROM mailbox,domain WHERE mailbox.username='%s' AND mailbox.domain='%d' AND mailbox.domain=domain.domain AND mailbox.transport<>'' AND mailbox.active=1 AND mailbox.enabledeliver=1 AND domain.backupmx=0 AND domain.active=1
Personal tools