iredmail-doc/html/upgrade.iredmail.0.9.4-0.9....

257 lines
16 KiB
HTML
Raw Normal View History

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Upgrade iRedMail from 0.9.4 to 0.9.5</title>
<link rel="stylesheet" type="text/css" href="./css/markdown.css" />
</head>
<body>
<div id="navigation">
2016-02-28 09:31:56 -06:00
<a href="http://www.iredmail.org" target="_blank"><img alt="iRedMail web site" src="images/logo-iredmail.png" style="vertical-align: middle; height: 30px;"/> <span>iRedMail</span></a>
2016-02-29 02:15:19 -06:00
&nbsp;&nbsp;//&nbsp;&nbsp;<a href="./index.html">Document Index</a></div><h1 id="upgrade-iredmail-from-094-to-095">Upgrade iRedMail from 0.9.4 to 0.9.5</h1>
<div class="toc">
<ul>
<li><a href="#upgrade-iredmail-from-094-to-095">Upgrade iRedMail from 0.9.4 to 0.9.5</a><ul>
<li><a href="#changelog">ChangeLog</a></li>
<li><a href="#general-all-backends-should-apply-these-steps">General (All backends should apply these steps)</a><ul>
<li><a href="#update-etciredmail-release-with-new-iredmail-version-number">Update /etc/iredmail-release with new iRedMail version number</a></li>
<li><a href="#upgrade-iredapd-postfix-policy-server-to-the-latest-190">Upgrade iRedAPD (Postfix policy server) to the latest 1.9.0</a></li>
<li><a href="#rhelcentos-fixed-not-enable-cron-job-to-update-spamassassin-rules">[RHEL/CentOS] Fixed: Not enable cron job to update SpamAssassin rules</a></li>
<li><a href="#rhelcentos-fixed-not-create-required-directory-used-to-store-php-session-files">[RHEL/CentOS] Fixed: Not create required directory used to store PHP session files</a></li>
<li><a href="#fixed-not-add-alias-for-virusalert-on-non-debianubuntu-oses">Fixed: not add alias for virusalert on non-Debian/Ubuntu OSes</a></li>
</ul>
</li>
<li><a href="#mysqlmariadb-backend-special">MySQL/MariaDB backend special</a><ul>
<li><a href="#new-support-postfix-sender_dependent_relayhost_maps">NEW: Support Postfix sender_dependent_relayhost_maps</a><ul>
<li><a href="#summary">Summary</a></li>
<li><a href="#create-sql-table-vmailsender_relayhost">Create SQL table vmail.sender_relayhost</a></li>
<li><a href="#create-sql-lookup-file-sender_dependent_relayhost_mapscf">Create SQL lookup file: sender_dependent_relayhost_maps.cf</a></li>
<li><a href="#update-postfix-settings-in-etcpostfixmaincf">Update Postfix settings in /etc/postfix/main.cf</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#postgresql-backend-special">PostgreSQL backend special</a><ul>
<li><a href="#new-support-postfix-sender_dependent_relayhost_maps_1">NEW: Support Postfix sender_dependent_relayhost_maps</a><ul>
<li><a href="#summary_1">Summary</a></li>
<li><a href="#create-sql-table-vmailsender_relayhost_1">Create SQL table vmail.sender_relayhost</a></li>
<li><a href="#create-sql-lookup-file-sender_dependent_relayhost_mapscf_1">Create SQL lookup file: sender_dependent_relayhost_maps.cf</a></li>
<li><a href="#update-postfix-settings-in-etcpostfixmaincf_1">Update Postfix settings in /etc/postfix/main.cf</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<h2 id="changelog">ChangeLog</h2>
<blockquote>
<p>We offer remote upgrade service, check <a href="../support.html">the price</a> and <a href="../contact.html">contact us</a>.</p>
</blockquote>
<ul>
<li>2016-03-08: [NEW] Supports Postfix <code>sender_dependent_relayhost_maps</code>.</li>
<li>2016-02-25:<ul>
<li>[RHEL/CentOS] Fixed: Not create required directory used to store PHP session files</li>
<li>[RHEL/CentOS] Fixed: Not enable cron job to update SpamAssassin rules</li>
<li>Fixed: not add alias for <code>virusalert</code> on non-Debian/Ubuntu OSes</li>
</ul>
</li>
</ul>
<h2 id="general-all-backends-should-apply-these-steps">General (All backends should apply these steps)</h2>
<h3 id="update-etciredmail-release-with-new-iredmail-version-number">Update <code>/etc/iredmail-release</code> with new iRedMail version number</h3>
<p>iRedMail stores the release version in <code>/etc/iredmail-release</code> after
installation, it's recommended to update this file after you upgraded iRedMail,
so that you can know which version of iRedMail you're running. For example:</p>
<pre><code># File: /etc/iredmail-release
0.9.5
</code></pre>
<h3 id="upgrade-iredapd-postfix-policy-server-to-the-latest-190">Upgrade iRedAPD (Postfix policy server) to the latest 1.9.0</h3>
<p>Please follow below tutorial to upgrade iRedAPD to the latest stable release:
<a href="./upgrade.iredapd.html">Upgrade iRedAPD to the latest stable release</a></p>
<p>Detailed release notes are available <a href="./iredapd.releases.html">here</a>.</p>
<h3 id="rhelcentos-fixed-not-enable-cron-job-to-update-spamassassin-rules">[RHEL/CentOS] Fixed: Not enable cron job to update SpamAssassin rules</h3>
<p>Note: this is applicable to only RHEL and CentOS.</p>
<p>In iRedMail-0.9.4 and earlier releases, iRedMail didn't enable cron job to
update SpamAssassin rules. Please run commands below to fix it.</p>
<pre><code class="shell">perl -pi -e 's/^(SAUPDATE=yes)/#${1}/' /etc/sysconfig/sa-update
echo 'SAUPDATE=yes' &gt;&gt; /etc/sysconfig/sa-update
</code></pre>
<h3 id="rhelcentos-fixed-not-create-required-directory-used-to-store-php-session-files">[RHEL/CentOS] Fixed: Not create required directory used to store PHP session files</h3>
<p>Note: this is applicable to only RHEL and CentOS if you're <strong>running Nginx + php-fpm</strong>.</p>
<p>In iRedMail-0.9.4 and earlier releases, iRedMail didn't create directory used
to store PHP session files, it will cause error when your PHP application tries
to create session file. Please fix it with commands below:</p>
<pre><code class="shell">mkdir /var/lib/php/session
chown root:root /var/lib/php/session
chmod 0773 /var/lib/php/session
chmod o+t /var/lib/php/session
</code></pre>
<h3 id="fixed-not-add-alias-for-virusalert-on-non-debianubuntu-oses">Fixed: not add alias for <code>virusalert</code> on non-Debian/Ubuntu OSes</h3>
<p>Note: this is <strong>NOT</strong> applicable to Debian and Ubuntu.</p>
<p>There's a bug in iRedMail-0.9.4, it adds alias <code>virusalert</code> on only Debian and
Ubuntu, but not other OSes. Please fix it with below commands:</p>
<ul>
<li>For Linux and OpenBSD:</li>
</ul>
<pre><code class="shell">perl -pi -e 's/(virusalert:.*)/#${1}/g' /etc/postfix/aliases
echo -e '\nvirusalert: root' &gt;&gt; /etc/postfix/aliases
postalias /etc/postfix/aliases
</code></pre>
<ul>
<li>For FreeBSD:</li>
</ul>
<pre><code class="shell">perl -pi -e 's/(virusalert:.*)/#${1}/g' /usr/local/etc/postfix/aliases
echo -e '\nvirusalert: root' &gt;&gt; /usr/local/etc/postfix/aliases
postalias /usr/local/etc/postfix/aliases
</code></pre>
<h2 id="mysqlmariadb-backend-special">MySQL/MariaDB backend special</h2>
<h3 id="new-support-postfix-sender_dependent_relayhost_maps">NEW: Support Postfix <code>sender_dependent_relayhost_maps</code></h3>
<h4 id="summary">Summary</h4>
<p>Postfix setting <code>relayhost</code> allows Postfix to relay outbound emails to
specified mail server instead of connecting recipient server directly. Sender
dependent relayhost (controlled by parameter <code>sender_dependent_relayhost_maps</code>)
allows you to define per-user or per-domain relayhost, it
overrides the global <code>relayhost</code> parameter setting. Specified query tables are
searched by the envelope sender address (<code>user@domain.com</code>) and domain name
(<code>@domain.com</code>). For more details, please read Postfix document:</p>
<ul>
<li>Postfix parameter: <a href="http://www.postfix.org/postconf.5.html#sender_dependent_relayhost_maps"><code>sender_dependent_relayhost_maps</code></a></li>
<li>Postfix manual page: <a href="http://www.postfix.org/transport.5.html">transport(5)</a></li>
</ul>
<p>To support <code>sender_dependent_relayhost_maps</code>, we need some modification on
iRedMail server:</p>
<ul>
<li>a new SQL table: <code>vmail.sender_relayhost</code></li>
<li>a new SQL lookup file: <code>/etc/postfix/mysql/sender_dependent_relayhost_maps.cf</code></li>
<li>a new Postfix parameter: <code>sender_dependent_relayhost_maps</code></li>
</ul>
<h4 id="create-sql-table-vmailsender_relayhost">Create SQL table <code>vmail.sender_relayhost</code></h4>
<p>Please connect to MySQL server as MySQL root user, and execute SQL commands
below to create this new table:</p>
<pre><code># mysql -uroot -p
sql&gt; USE vmail;
sql&gt; CREATE TABLE IF NOT EXISTS sender_relayhost (
id BIGINT(20) UNSIGNED AUTO_INCREMENT,
account VARCHAR(255) NOT NULL DEFAULT '',
relayhost VARCHAR(255) NOT NULL DEFAULT '',
PRIMARY KEY (id),
UNIQUE INDEX (account)
) ENGINE=InnoDB;
</code></pre>
<h4 id="create-sql-lookup-file-sender_dependent_relayhost_mapscf">Create SQL lookup file: <code>sender_dependent_relayhost_maps.cf</code></h4>
<ul>
<li>On Linux/OpenBSD, please <strong>COPY</strong> file <code>/etc/postfix/mysql/catchall_maps.cf</code>
to <code>/etc/postfix/mysql/sender_dependent_relayhost_maps.cf</code>.</li>
<li>On FreeBSD, please <strong>COPY</strong> file <code>/usr/local/etc/postfix/mysql/catchall_maps.cf</code>
to <code>/usr/local/etc/postfix/mysql/sender_dependent_relayhost_maps.cf</code>.</li>
</ul>
<p>Open file <code>sender_dependent_relayhost_maps.cf</code>, <strong>REPLACE</strong> the <code>query =</code> line
by below one:</p>
<pre><code>query = SELECT relayhost FROM sender_relayhost WHERE account='%s' LIMIT 1
</code></pre>
<h4 id="update-postfix-settings-in-etcpostfixmaincf">Update Postfix settings in <code>/etc/postfix/main.cf</code></h4>
<p>We need to update 2 parameters in Postfix config file: <code>proxy_read_maps</code>,
<code>sender_dependent_relayhost_maps</code>.</p>
<ul>
<li>On <strong>Linux/OpenBSD</strong>, please run 2 commands below to update Postfix settings:</li>
</ul>
<pre><code>postconf -e proxy_read_maps ='$canonical_maps $lmtp_generic_maps $local_recipient_maps $mydestination $mynetworks $recipient_bcc_maps $recipient_canonical_maps $relay_domains $relay_recipient_maps $relocated_maps $sender_bcc_maps $sender_canonical_maps $smtp_generic_maps $smtpd_sender_login_maps $transport_maps $virtual_alias_domains $virtual_alias_maps $virtual_mailbox_domains $virtual_mailbox_maps $smtpd_sender_restrictions $sender_dependent_relayhost_maps'
postconf -e sender_dependent_relayhost_maps='proxy:mysql:/etc/postfix/mysql/sender_dependent_relayhost_maps.cf'
</code></pre>
<p>Reload or restart Postfix service is required.</p>
<ul>
<li>On <strong>FreeBSD</strong>, please run 2 commands below to update Postfix settings:</li>
</ul>
<pre><code>postconf -e proxy_read_maps ='$canonical_maps $lmtp_generic_maps $local_recipient_maps $mydestination $mynetworks $recipient_bcc_maps $recipient_canonical_maps $relay_domains $relay_recipient_maps $relocated_maps $sender_bcc_maps $sender_canonical_maps $smtp_generic_maps $smtpd_sender_login_maps $transport_maps $virtual_alias_domains $virtual_alias_maps $virtual_mailbox_domains $virtual_mailbox_maps $smtpd_sender_restrictions $sender_dependent_relayhost_maps'
postconf -e sender_dependent_relayhost_maps='proxy:mysql:/usr/local/etc/postfix/mysql/sender_dependent_relayhost_maps.cf'
</code></pre>
<p>Reload or restart Postfix service is required.</p>
<h2 id="postgresql-backend-special">PostgreSQL backend special</h2>
<h3 id="new-support-postfix-sender_dependent_relayhost_maps_1">NEW: Support Postfix <code>sender_dependent_relayhost_maps</code></h3>
<h4 id="summary_1">Summary</h4>
<p>Postfix setting <code>relayhost</code> allows Postfix to relay outbound emails to
specified mail server instead of connecting recipient server directly. Sender
dependent relayhost (controlled by parameter <code>sender_dependent_relayhost_maps</code>)
allows you to define per-user or per-domain relayhost, it
overrides the global <code>relayhost</code> parameter setting. Specified query tables are
searched by the envelope sender address (<code>user@domain.com</code>) and domain name
(<code>@domain.com</code>). For more details, please read Postfix document:</p>
<ul>
<li>Postfix parameter: <a href="http://www.postfix.org/postconf.5.html#sender_dependent_relayhost_maps"><code>sender_dependent_relayhost_maps</code></a></li>
<li>Postfix manual page: <a href="http://www.postfix.org/transport.5.html">transport(5)</a></li>
</ul>
<p>To support <code>sender_dependent_relayhost_maps</code>, we need some modification on
iRedMail server:</p>
<ul>
<li>a new SQL table: <code>vmail.sender_relayhost</code></li>
<li>a new SQL lookup file: <code>/etc/postfix/mysql/sender_dependent_relayhost_maps.cf</code></li>
<li>a new Postfix parameter: <code>sender_dependent_relayhost_maps</code></li>
</ul>
<h4 id="create-sql-table-vmailsender_relayhost_1">Create SQL table <code>vmail.sender_relayhost</code></h4>
<p>Please follow steps below to create this new table:</p>
<pre><code># su - postgres
$ psql -d vmail
sql&gt; CREATE TABLE sender_relayhost (
id SERIAL PRIMARY KEY,
account VARCHAR(255) NOT NULL DEFAULT '',
relayhost VARCHAR(255) NOT NULL DEFAULT ''
);
sql&gt; CREATE INDEX idx_sender_relayhost_account ON sender_relayhost (account);
</code></pre>
<h4 id="create-sql-lookup-file-sender_dependent_relayhost_mapscf_1">Create SQL lookup file: <code>sender_dependent_relayhost_maps.cf</code></h4>
<ul>
<li>On Linux/OpenBSD, please <strong>COPY</strong> file <code>/etc/postfix/pgsql/catchall_maps.cf</code>
to <code>/etc/postfix/pgsql/sender_dependent_relayhost_maps.cf</code>.</li>
<li>On FreeBSD, please <strong>COPY</strong> file <code>/usr/local/etc/postfix/pgsql/catchall_maps.cf</code>
to <code>/usr/local/etc/postfix/pgsql/sender_dependent_relayhost_maps.cf</code>.</li>
</ul>
<p>Open file <code>sender_dependent_relayhost_maps.cf</code>, <strong>REPLACE</strong> the <code>query =</code> line
by below one:</p>
<pre><code>query = SELECT relayhost FROM sender_relayhost WHERE account='%s' LIMIT 1
</code></pre>
<h4 id="update-postfix-settings-in-etcpostfixmaincf_1">Update Postfix settings in <code>/etc/postfix/main.cf</code></h4>
<p>We need to update 2 parameters in Postfix config file: <code>proxy_read_maps</code>,
<code>sender_dependent_relayhost_maps</code>.</p>
<ul>
<li>On <strong>Linux/OpenBSD</strong>, please run 2 commands below to update Postfix settings:</li>
</ul>
<pre><code>postconf -e proxy_read_maps ='$canonical_maps $lmtp_generic_maps $local_recipient_maps $mydestination $mynetworks $recipient_bcc_maps $recipient_canonical_maps $relay_domains $relay_recipient_maps $relocated_maps $sender_bcc_maps $sender_canonical_maps $smtp_generic_maps $smtpd_sender_login_maps $transport_maps $virtual_alias_domains $virtual_alias_maps $virtual_mailbox_domains $virtual_mailbox_maps $smtpd_sender_restrictions $sender_dependent_relayhost_maps'
postconf -e sender_dependent_relayhost_maps='proxy:pgsql:/etc/postfix/pgsql/sender_dependent_relayhost_maps.cf'
</code></pre>
<p>Reload or restart Postfix service is required.</p>
<ul>
<li>On <strong>FreeBSD</strong>, please run 2 commands below to update Postfix settings:</li>
</ul>
<pre><code>postconf -e proxy_read_maps ='$canonical_maps $lmtp_generic_maps $local_recipient_maps $mydestination $mynetworks $recipient_bcc_maps $recipient_canonical_maps $relay_domains $relay_recipient_maps $relocated_maps $sender_bcc_maps $sender_canonical_maps $smtp_generic_maps $smtpd_sender_login_maps $transport_maps $virtual_alias_domains $virtual_alias_maps $virtual_mailbox_domains $virtual_mailbox_maps $smtpd_sender_restrictions $sender_dependent_relayhost_maps'
postconf -e sender_dependent_relayhost_maps='proxy:mysql:/usr/local/etc/postfix/mysql/sender_dependent_relayhost_maps.cf'
</code></pre>
<p>Reload or restart Postfix service is required.</p><p style="text-align: center; color: grey;">All documents are available in <a href="https://bitbucket.org/zhb/iredmail-docs/src">BitBucket repository</a>, and published under <a href="http://creativecommons.org/licenses/by-nd/3.0/us/" target="_blank">Creative Commons</a> license. If you found something wrong, please do <a href="http://www.iredmail.org/contact.html">contact us</a> to fix it.<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-3293801-21', 'auto');
ga('send', 'pageview');
</script>
</body></html>