// <ahref="./index.html">Document Index</a></div><h1id="upgrade-iredmail-from-084-to-085">Upgrade iRedMail from 0.8.4 to 0.8.5</h1>
<li><ahref="#upgrade-iredmail-from-084-to-085">Upgrade iRedMail from 0.8.4 to 0.8.5</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-stable-release">Upgrade iRedAPD (Postfix policy server) to the latest stable release</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="#use-the-latest-ldap-schema-file-provided-by-iredmail">Use the latest LDAP schema file provided by iRedMail</a></li>
<li><ahref="#fix-incorrect-acl-for-attribute-memberofgroup">Fix incorrect ACL for attribute memberOfGroup</a></li>
<li><ahref="#support-assigning-mail-listalias-as-member-of-another-mailing-list">Support assigning mail list/alias as member of another mailing list</a></li>
<li><ahref="#fix-incorrect-sql-column-name-in-amavisd-database">Fix incorrect SQL column name in Amavisd database</a></li>
<li><ahref="#add-sql-trigger-in-mysql-database-iredadmin">Add SQL trigger in MySQL database: iredadmin</a></li>
<li><ahref="#add-new-table-in-mysql-database-iredadmin">Add new table in MySQL database: iredadmin</a></li>
<li>2013-06-27: [All backends] Add new SQL table: deleted_mailboxes. Used to store maildir path of removed mail user, used in iRedAdmin-Pro.</li>
<li>2013-06-08: [All backends] Add SQL trigger for table <code>used_quota</code>.</li>
<li>2013-06-08: [MySQL/PostgreSQL] Add 2 new columns on table <code>vmail.domain</code>: <code>disableddomainprofiles</code>, <code>disableduserprofiles</code>. Used in iRedAdmin-Pro.</li>
<li>2013-05-17: [ldap] Support assigning mail list/alias as member of another mailing list.</li>
<li>Open Postfix ldap lookup file <code>/etc/postfix/ldap/virtual_group_maps.cf</code> (or <code>/usr/local/etc/postfix/ldap/virtual_group_maps.cf</code> on FreeBSD), update the value of <code>query_filter</code> parameter to add additional LDAP objectclasses:</li>
<h3id="add-new-sql-columns-in-vmail-database">Add new SQL columns in vmail database</h3>
<ul>
<li>New column <code>domain.defaultlanguage</code>, used to storage short language code (e.g. de_DE, en_US) for newly created mail users. It's used in iRedAdmin-Pro.</li>
<li>New column <code>domain.disableddomainprofiles</code>, used to store per-domain disabled domain profiles. It's used in iRedAdmin-Pro, global admin can select which profiles are disabled in domain profile page, and normal domain admin cannot view and update disabled domain profiles in domain profile page.</li>
<li>New column <code>domain.disableduserprofiles</code>, used to store per-domain disabled user profiles. It's used in iRedAdmin-Pro, global admin can select which profiles are disabled in domain profile page, and normal domain admin cannot view and update disabled user profiles in user profile page.</li>
</ul>
<p>Please login to MySQL server as root user, execute SQL commands to add required columns and indexes.</p>
<pre><code># mysql -uroot -p
mysql> USE vmail;
mysql> ALTER TABLE domain ADD COLUMN defaultlanguage VARCHAR(5) NOT NULL DEFAULT 'en_US';
mysql> ALTER TABLE domain ADD COLUMN disableddomainprofiles VARCHAR(255) NOT NULL DEFAULT '';
mysql> ALTER TABLE domain ADD COLUMN disableduserprofiles VARCHAR(255) NOT NULL DEFAULT '';
</code></pre>
<p>No INDEX is required for those 3 new columns.</p>
<h3id="fix-incorrect-column-name-in-amavisd-database">fix incorrect column name in Amavisd database</h3>
<p>NOTE: This fix is applicable to Amavisd-new-2.7 and later versions, not applicable to Amavisd-new-2.6 and earlier versions.</p>
<p>Amavisd-new-2.7.1 fixes a SQL column name "policy.unchecked_lover", previously incorrectly specified as "policy.unchecked_lovers_maps";</p>
<pre><code># mysql -uroot -p
mysql> USE amavisd;
mysql> ALTER TABLE policy CHANGE unchecked_lovers_maps unchecked_lover CHAR(1) DEFAULT NULL;
</code></pre>
<h3id="add-sql-trigger-in-mysql-database-vmail">Add SQL trigger in MySQL database <code>vmail</code></h3>
<p>With MySQL backend, Dovecot stores real-time mailbox quota in MySQL table
<code>vmail.used_quota</code>. But it's hard to calculate per-domain used mailbox quota,
so we add a SQL trigger to set domain name while Dovecot inserting new record
for mail user.</p>
<ul>
<li>Please save below SQL command in a plain text file. For example, <code>/root/trigger.sql</code>:</li>
<h3id="add-new-sql-columns-in-vmail-database_1">Add new SQL columns in vmail database</h3>
<ul>
<li>New column <code>domain.defaultlanguage</code>, used to storage short language code (e.g. de_DE, en_US) for newly created mail users. It's used in iRedAdmin-Pro.</li>
<li>New column <code>domain.disableddomainprofiles</code>, used to store per-domain disabled domain profiles. It's used in iRedAdmin-Pro, global admin can select which profiles are disabled in domain profile page, and normal domain admin cannot view and update disabled domain profiles in domain profile page.</li>
<li>New column <code>domain.disableduserprofiles</code>, used to store per-domain disabled user profiles. It's used in iRedAdmin-Pro, global admin can select which profiles are disabled in domain profile page, and normal domain admin cannot view and update disabled user profiles in user profile page.</li>
</ul>
<p>Please switch to PostgreSQL daemon user, then execute SQL commands to add required columns and indexes:</p>
<ul>
<li>On Linux, PostgreSQL daemon user is <code>postgres</code>.</li>
<li>On FreeBSD, PostgreSQL daemon user is <code>pgsql</code>.</li>
<li>On OpenBSD, PostgreSQL daemon user is <code>_postgresql</code>.</li>
</ul>
<pre><code># su - postgres
$ psql -d vmail
sql> ALTER TABLE domain ADD COLUMN defaultlanguage VARCHAR(5) NOT NULL DEFAULT 'en_US';
sql> ALTER TABLE domain ADD COLUMN disableddomainprofiles VARCHAR(255) NOT NULL DEFAULT '';
sql> ALTER TABLE domain ADD COLUMN disableduserprofiles VARCHAR(255) NOT NULL DEFAULT '';
</code></pre>
<p>No INDEX is required for these 3 new columns.</p>
<h3id="fix-incorrect-column-name-in-amavisd-database_1">Fix incorrect column name in Amavisd database</h3>
<p>NOTE: This fix is applicable to Amavisd-new-2.7 and later versions, not
applicable to Amavisd-new-2.6 and earlier versions.</p>
<p>Amavisd-new-2.7.1 fixes a SQL column name <code>policy.unchecked_lover</code>, previously
incorrectly specified as <code>policy.unchecked_lovers_maps</code>.</p>
<pre><code># su - postgres
$ psql -d amavisd
sql> ALTER TABLE policy RENAME unchecked_lovers_maps TO unchecked_lover;
</code></pre>
<h3id="add-sql-trigger-in-postgresql-database-vmail">Add SQL trigger in PostgreSQL database: <code>vmail</code></h3>
<p>With PostgreSQL backend, Dovecot stores real-time mailbox quota in PostgreSQL
database <code>vmail</code>, table <code>used_quota</code>. But it's hard to calculate per-domain
used mailbox quota, so we add a SQL trigger to set domain name while Dovecot
inserting new record for mail user.</p>
<ul>
<li>Please save below SQL command in a plain text file. For example,
<code>/tmp/trigger.sql</code> (This file must be readable by PostgreSQL daemon user):</li>
<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>