MailSuite Pro documentation

Upgrading instructions

If you installed the product from the repository, it's updated along with the operating system. Typically it's done automatically in the background so you're always on the latest version, but you can force the upgrade with:

apt update
apt install mailsuite-pro

Upgrading to 9.8.2 or newer from 9.8.1 or previous one

In version 9.8.2, handling mailing lists was substantially rewritten, and while database and PHP code is updated automatically upon the upgrade, changes to Exim and Dovecot configuration files need to be made manually.

Lines which start with # are commented out so it's safe to disregard those.

  1. /etc/dovecot/dovecot-sql.conf file

Locate connect line:

connect = host=/var/run/mysqld/mysqld.sock    dbname=afterlogic user=afterlogic password=#mypassword#

and replace it with:

connect = host=/var/run/mysqld/mysqld.sock dbname=afterlogic user=afterlogic password=#mypassword#
  1. Locate user_query line:
user_query = SELECT DISTINCT LOWER(awm_accounts.email) as login, CONCAT('*:storage=', awm_accounts.mail_quota_kb) as quota_rule FROM (awm_accounts INNER JOIN awm_domains ON awm_accounts.id_domain = awm_domains.id_domain) WHERE (awm_accounts.email = CONCAT('%n', '@', '%d') OR awm_accounts.email = '%n') AND awm_domains.name = '%d' AND awm_accounts.deleted = 0 AND awm_accounts.mailing_list = 0;

and replace it with:

user_query = SELECT DISTINCT LOWER(awm_accounts.email) as login, CONCAT('*:storage=', awm_accounts.mail_quota_kb) as quota_rule FROM (awm_accounts INNER JOIN awm_domains ON awm_accounts.id_domain = awm_domains.id_domain) WHERE (awm_accounts.email = CONCAT('%n', '@', '%d') OR awm_accounts.email = '%n') AND awm_domains.name = '%d' AND awm_accounts.deleted = 0;
  1. Locate password_query and iterate_query lines:
password_query = SELECT DISTINCT CONCAT('{SSHA256.hex}', awm_accounts.password) as password FROM awm_accounts INNER JOIN awm_domains ON awm_accounts.id_domain = awm_domains.id_domain WHERE (awm_accounts.email = CONCAT('%n', '@', '%d') OR awm_accounts.email = '%n') AND awm_domains.name = '%d' AND awm_accounts.deleted = 0 AND awm_accounts.mailing_list = 0;
iterate_query = SELECT DISTINCT substring(email, 1, locate('@', email) - 1) as username, substring(email, locate('@', email) + 1) as domain FROM awm_accounts INNER JOIN awm_domains ON awm_accounts.id_domain = awm_domains.id_domain WHERE awm_accounts.deleted = 0;

and replace those with:

password_query = SELECT DISTINCT CONCAT('{SSHA256.hex}', awm_accounts.password) as password FROM awm_accounts INNER JOIN awm_domains ON awm_accounts.id_domain = awm_domains.id_domain WHERE (awm_accounts.email = CONCAT('%n', '@', '%d') OR awm_accounts.email = '%n') AND awm_domains.name = '%d' AND awm_accounts.deleted = 0;
iterate_query = SELECT DISTINCT substring(email, 1, locate('@', email) - 1) as username, substring(email, locate('@', email) + 1) as domain FROM awm_accounts WHERE deleted = 0;
  1. /etc/exim4/exim4.conf file

Locate QUOTA_NEW line:

QUOTA_NEW = SELECT quota FROM awm_accounts WHERE email = '${quote_mysql:$local_part}@${quote_mysql:$domain}' or email='${quote_mysql:$local_part}' LIMIT 1

and replace it with:

QUOTA_NEW = SELECT quota FROM awm_accounts WHERE email = '${quote_mysql:$local_part}@${quote_mysql:$domain}' or email = '${quote_mysql:$local_part}' LIMIT 1
  1. Locate MYSQL_ALIASES, MYSQL_ML and MYSQL_USER lines:
MYSQL_ALIASES = select alias_to from awm_mailaliases where alias_name='${quote_mysql:$local_part}' AND alias_domain='${quote_mysql:$domain}'
MYSQL_ML = SELECT list_to FROM awm_mailinglists WHERE list_name='${quote_mysql:$local_part}@${quote_mysql:$domain}'
MYSQL_USER = SELECT distinct awm_accounts.email as login FROM awm_accounts INNER JOIN awm_domains ON awm_accounts.id_domain = awm_domains.id_domain WHERE  (awm_accounts.email = CONCAT('${quote_mysql:$local_part}', '@', '${quote_mysql:$domain}') OR awm_accounts.email = '${quote_mysql:$local_part}') AND awm_domains.name = '${quote_mysql:$domain}' AND awm_accounts.deleted = 0;

and replace those with:

MYSQL_ALIASES = SELECT alias_to FROM awm_mailaliases WHERE alias_name = '${quote_mysql:$local_part}' AND alias_domain = '${quote_mysql:$domain}'
MYSQL_ML = SELECT list_to FROM awm_mailinglist_members AS members LEFT JOIN awm_mailinglists AS lists ON members.id_mailinglist = lists.id WHERE lists.name = '${quote_mysql:$local_part}@${quote_mysql:$domain}' AND lists.deleted = 0
MYSQL_USER = SELECT DISTINCT email as login FROM ( SELECT a.email, a.id_domain FROM awm_accounts AS a WHERE ( a.email = CONCAT('${quote_mysql:$local_part}', '@', '${quote_mysql:$domain}') OR a.email = '${quote_mysql:$local_part}' ) AND a.deleted = 0 UNION SELECT l.name as email, l.id_domain FROM awm_mailinglists AS l WHERE ( l.name = CONCAT('${quote_mysql:$local_part}', '@', '${quote_mysql:$domain}') OR l.name = '${quote_mysql:$local_part}' ) AND l.deleted = 0 ) AS results INNER JOIN awm_domains ON results.id_domain = awm_domains.id_domain WHERE awm_domains.name = '${quote_mysql:$domain}'
  1. Restart the services with the following commands run as root/superuser:
service dovecot restart
service exim4 restart

The above changes also apply to upgrading a legacy package (see below).

Upgrading a legacy package

To upgrade from previous v9 of MailSuite Pro installed via Ansible (available as legacy package as of v9.8 release), there's no need to reinstall the entire environment, you just need to update the web components. Backup html/data/ directory, deploy new package and bring data directory back:

curl http://afterlogic.com/download/webmail-pro-mta.zip -o webmail-pro-mta.zip
mv /opt/afterlogic/html/data /opt/afterlogic/data_bak
rm -rf /opt/afterlogic/html
unzip webmail-pro-mta.zip -d /opt/afterlogic/html
rm -rf /opt/afterlogic/html/data
mv /opt/afterlogic/data_bak /opt/afterlogic/html/data
chown -R afterlogic:afterlogic /opt/afterlogic/html/data

Then log into admin interface and run "Create/Update Tables" and "Update Configuration" tools under Database Settings screen.

Version 9.8 of the product brings several security improvements. Though the product will keep functioning correctly upon performing the standard upgrade, we strongly recommend to update encryption key.

To update encryption key, run the following script:

php /opt/afterlogic/html/dev/update-encryption-key.php

and follow the on-screen instructions. The script will update encrypted passwords stored in the database (account passwords, SMTP server relay passwords etc.) as well as encrypted values in configuration files of several modules.