// <ahref="./index.html">Document Index</a></div><h1id="upgrade-iredmail-from-086-to-087">Upgrade iRedMail from 0.8.6 to 0.8.7</h1>
<li><ahref="#upgrade-iredmail-from-086-to-087">Upgrade iRedMail from 0.8.6 to 0.8.7</a><ul>
<li><ahref="#changelog">ChangeLog</a></li>
<li><ahref="#general-all-backends-should-apply-these-steps">General (All backends should apply these steps)</a><ul>
<li><ahref="#update-etciredmail-release-with-iredmail-version-number">Update /etc/iredmail-release with iRedMail version number</a></li>
<li><ahref="#upgrade-roundcube-webmail-to-the-latest-stable-release">Upgrade Roundcube webmail to the latest stable release</a></li>
<li><ahref="#upgrade-iredapd-postfix-policy-server-to-the-latest-143">Upgrade iRedAPD (Postfix policy server) to the latest 1.4.3</a></li>
<li><ahref="#upgrade-iredadmin-open-source-edition-to-the-latest-stable-release">Upgrade iRedAdmin (open source edition) to the latest stable release</a></li>
<li><ahref="#upgrade-phpmyadmin-to-the-latest-stable-release">Upgrade phpMyAdmin to the latest stable release</a></li>
<li><ahref="#optional-allows-smtp-sasl-authentication-only-over-a-tls-encrypted-smtp-connection">[OPTIONAL] Allows SMTP SASL authentication ONLY over a TLS-encrypted smtp connection</a></li>
<li><ahref="#optional-enable-lmtp-service-in-dovecot-2x">[OPTIONAL] Enable LMTP service in Dovecot-2.x</a></li>
<li><ahref="#optional-fixed-issue-postfix-cannot-resolve-client-ip-address-to-dns-name-on-rhelcentos">[OPTIONAL] Fixed issue: Postfix cannot resolve client IP address to DNS name on RHEL/CentOS</a></li>
<p>NOTE: Since phpMyAdmin-4.2.3.0, it enforces the minimum PHP (5.3) and MySQL (5.5) versions.</p>
<h3id="optional-allows-smtp-sasl-authentication-only-over-a-tls-encrypted-smtp-connection">[OPTIONAL] Allows SMTP SASL authentication ONLY over a TLS-encrypted smtp connection</h3>
<ul>
<li>This step is optional.</li>
<li>WARNING: With this Postfix change, mail users must configure their mail
client applications (Outlook, Thunderbird, etc) to enable TLS (port 25 or
587) or SSL (port 465) for sending email.</li>
</ul>
<p>To allow SMTP SASL authentication ONLY over a TLS-encrypted smtp connection,
just change value of parameter <code>smtpd_tls_auth_only</code> to <code>yes</code>, and reload
<h3id="optional-fixed-issue-postfix-cannot-resolve-client-ip-address-to-dns-name-on-rhelcentos">[OPTIONAL] Fixed issue: Postfix cannot resolve client IP address to DNS name on RHEL/CentOS</h3>
<p>This is optional.</p>
<p>On RHEL/CentOS, Postfix is running under chroot, it logs client IP address in
log file, but cannot resolve IP to DNS name. You can fix it with below steps:</p>
<li><code>alias.islist</code>: used to mark a sql record is a mail list account, default value is <code>0</code> (means not a mail list account). This helps avoid complex SQL queries.</li>
</ul>
<p>Some existing columns in table <code>vmail.domain</code> are not needed anymore, they will
be merged into our new column: <code>domain.settings</code>.</p>
<p>Now connect to SQL server as root user, create new columns, add required
indexes for new column <code>alias.islist</code>, and update value of <code>alias.islist</code> for
existing accounts:</p>
<pre><code>$ mysql -uroot -p
mysql> USE vmail;
mysql> ALTER TABLE mailbox ADD COLUMN enablelmtp TINYINT(1) NOT NULL DEFAULT 1;
mysql> ALTER TABLE mailbox ADD INDEX (enablelmtp);
mysql> ALTER TABLE mailbox ADD COLUMN settings TEXT;
mysql> ALTER TABLE domain ADD COLUMN settings TEXT;
mysql> ALTER TABLE admin ADD COLUMN settings TEXT;
mysql> ALTER TABLE alias ADD COLUMN islist TINYINT(1) NOT NULL DEFAULT 0;
mysql> ALTER TABLE alias ADD INDEX (islist);
mysql> UPDATE alias SET islist=1 WHERE address NOT IN (SELECT username FROM mailbox);
mysql> UPDATE alias SET islist=0 WHERE address=domain; -- domain catch-all account
-- Remove old columns and store their value into new column: domain.settings
mysql> UPDATE domain SET settings='';
mysql> UPDATE domain SET settings=CONCAT(settings, IF(defaultlanguage IS NULL OR defaultlanguage='', '', CONCAT('default_language:', defaultlanguage, ';')));
mysql> UPDATE domain SET settings=CONCAT(settings, IF(defaultuserquota IS NULL OR defaultuserquota=0, '', CONCAT('default_user_quota:', defaultuserquota, ';')));
mysql> UPDATE domain SET settings=CONCAT(settings, IF(defaultuseraliases IS NULL OR defaultuseraliases='', '', CONCAT('default_groups:', defaultuseraliases, ';')));
mysql> UPDATE domain SET settings=CONCAT(settings, IF(minpasswordlength IS NULL OR minpasswordlength=0, '', CONCAT('min_passwd_length:', minpasswordlength, ';')));
mysql> UPDATE domain SET settings=CONCAT(settings, IF(maxpasswordlength IS NULL OR maxpasswordlength=0, '', CONCAT('max_passwd_length:', maxpasswordlength, ';')));
mysql> UPDATE domain SET settings=CONCAT(settings, IF(disableddomainprofiles IS NULL OR disableddomainprofiles='', '', CONCAT('disabled_domain_profiles:', disableddomainprofiles, ';')));
mysql> UPDATE domain SET settings=CONCAT(settings, IF(disableduserprofiles IS NULL OR disableduserprofiles='', '', CONCAT('disabled_user_profiles:', disableduserprofiles, ';')));
mysql> ALTER TABLE domain DROP defaultlanguage;
mysql> ALTER TABLE domain DROP defaultuserquota;
mysql> ALTER TABLE domain DROP defaultuseraliases;
mysql> ALTER TABLE domain DROP minpasswordlength;
mysql> ALTER TABLE domain DROP maxpasswordlength;
mysql> ALTER TABLE domain DROP disableddomainprofiles;
mysql> ALTER TABLE domain DROP disableduserprofiles;
<li><code>alias.islist</code>: used to mark a sql record is a mail list account, default value is <code>0</code> (means not a mail list account). This helps avoid complex SQL queries.</li>
</ul>
<p>Some existing columns in table <code>vmail.domain</code> are not needed anymore, they will
be merged into our new column: <code>domain.settings</code>.</p>
<p>Now connect to SQL server as PostgreSQL administrator user, create new columns,
add required indexes for new column <code>alias.islist</code>, and update value of
<code>alias.islist</code> for existing accounts:</p>
<pre><code># su - postgres
$ psql -d vmail
sql> ALTER TABLE mailbox ADD COLUMN enablelmtp INT2 NOT NULL DEFAULT 1;
sql> CREATE INDEX idx_mailbox_enablelmtp ON mailbox (enablelmtp);
sql> ALTER TABLE mailbox ADD COLUMN settings TEXT NOT NULL DEFAULT '';
sql> ALTER TABLE domain ADD COLUMN settings TEXT NOT NULL DEFAULT '';
sql> ALTER TABLE admin ADD COLUMN settings TEXT NOT NULL DEFAULT '';
sql> ALTER TABLE alias ADD COLUMN islist INT2 NOT NULL DEFAULT 0;
sql> CREATE INDEX idx_alias_islist ON alias (islist);
sql> UPDATE alias SET islist=1 WHERE address NOT IN (SELECT username FROM mailbox);
sql> UPDATE alias SET islist=0 WHERE address=domain; -- domain catch-all account
-- Remove old columns and store their value into new column: domain.settings
<pstyle="text-align: center; color: grey;">All documents are available in <ahref="https://bitbucket.org/zhb/iredmail-docs/src">BitBucket repository</a>, and published under <ahref="http://creativecommons.org/licenses/by-nd/3.0/us/"target="_blank">Creative Commons</a> license. You can <ahref="https://bitbucket.org/zhb/iredmail-docs/get/tip.tar.bz2">download the latest version</a> for offline reading. If you found something wrong, please do <ahref="http://www.iredmail.org/contact.html">contact us</a> to fix it.</p>