<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
/var/log/dovecot-lmtp.log vmail:vmail 600 7 * 24 Z "/usr/local/bin/doveadm log reopen"
</code></pre>
<ul>
<li>Restarting Dovecot service is required.</li>
</ul>
<pre><code># ---- On Linux ----
# /etc/init.d/dovecot restart
# ---- On FreeBSD ----
# /usr/local/etc/rc.d/dovecot restart
# ---- On OpenBSD ----
# /etc/rc.d/dovecot restart
</code></pre>
<p>That's all. You can now check whether Dovecot is listening on port 24 and
created socket file <code>/var/spool/postfix/private/dovecot-lmtp</code> for LMTP service.</p>
<pre><code># ---- On Linux ----
# netstat -ntlp | grep ':24'
# ls -l /var/spool/postfix/private/dovecot-lmtp
</code></pre>
<p>To use LMTP as local mail delivery agent, you can use either
<code>lmtp:unix:private/dovecot-lmtp</code> (local socket) or <code>lmtp:inet:127.0.0.1:24</code>
(network listener). Currently, default mail delivery agent is <code>dovecot</code>
(Dovecot LDA). For example:</p>
<ul>
<li>For OpenLDAP backend, you can set domain transport to LMTP in domain object
with this attribute/value: <code>mtaTransport=lmtp:unix:private/dovecot-lmtp</code></li>
<li>For MySQL and PostgreSQL backends, you can set with this SQL command:</li>
</ul>
<pre><code>mysql> USE vmail;
mysql> UPDATE domain SET transport='lmtp:unix:private/dovecot-lmtp' WHERE domain='abc.com';
</code></pre>
<p><strong>IMPORTANT NOTE</strong>: it requires new LDAP value or SQL column for mail users
mentioned in this upgrade tutorial (LDAP: <code>enabledService=lmtp</code>, SQL:
<code>mailbox.enablelmtp=1</code>), so please finish this upgrade tutorial first, then
you're safe to use LMTP.</p>
<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
</code></pre><pstyle="text-align: center; color: grey;">Document published under a <ahref="http://creativecommons.org/licenses/by-nd/3.0/us/"target="_blank">CC BY-ND 3.0</a> license. If you found something wrong, please do <ahref="http://www.iredmail.org/contact.html">contact us</a> to fix it.<script>