// <ahref="./index.html">Document Index</a></div><h1id="upgrade-iredmail-from-121-to-13">Upgrade iRedMail from 1.2.1 to 1.3</h1>
<divclass="toc">
<ul>
<li><ahref="#upgrade-iredmail-from-121-to-13">Upgrade iRedMail from 1.2.1 to 1.3</a><ul>
<li><ahref="#changelog">ChangeLog</a></li>
<li><ahref="#general-all-backends-should-apply-these-changes">General (All backends should apply these changes)</a><ul>
<li><ahref="#update-etciredmail-release-with-new-iredmail-version-number">Update /etc/iredmail-release with new iRedMail version number</a></li>
<li><ahref="#add-missing-index-for-sql-column-msgstime_iso-in-amavisd-database">Add missing index for SQL column msgs.time_iso in amavisd database</a></li>
<li><ahref="#add-missing-index-for-sql-column-msgstime_iso-in-amavisd-database_1">Add missing index for SQL column msgs.time_iso in amavisd database</a></li>
<h3id="add-missing-index-for-sql-column-msgstime_iso-in-amavisd-database">Add missing index for SQL column <code>msgs.time_iso</code> in <code>amavisd</code> database</h3>
<p>Please run SQL commands below as MySQL root user:</p>
<pre><code>USE amavisd;
CREATE INDEX msgs_idx_time_iso ON msgs (time_iso);
<h3id="improvement-store-more-info-in-fail2ban-sql-db">Improvement: Store more info in Fail2ban SQL db</h3>
<divclass="admonition attention">
<pclass="admonition-title">Attention</p>
<p>Since iRedMail-1.2, Fail2ban is configured to <ahref="./fail2ban.sql.html">store banned IP addresses in
SQL database</a>, if you're running an old iRedMail
release, please upgrade your iRedMail server by following the upgrade
tutorials: <ahref="./iredmail.releases.html">iRedMail release notes and upgrade tutorials</a>.</p>
</div>
<p>With changes below, we now store matched log lines which triggerred the ban in
Fail2ban SQL database, also number of times the failure occurred in log files.</p>
<p>Please run SQL commands below as MySQL root user:</p>
<pre><code>USE fail2ban;
ALTER TABLE banned ADD COLUMN failures INT(2) NOT NULL DEFAULT 0;
ALTER TABLE banned ADD COLUMN loglines TEXT;
</code></pre>
<p>Now open file <code>/etc/fail2ban/action.d/banned_db.conf</code>, find the <code>actionban =</code>
line like below:</p>
<pre><code>actionban = /usr/local/bin/fail2ban_banned_db ban <ip><port><protocol><name>
</code></pre>
<p>Replace it by:</p>
<pre><code>actionban = /usr/local/bin/fail2ban_banned_db ban <ip><port><protocol><name><ipjailfailures><ipjailmatches>
</code></pre>
<p>Download improved shell script and replace the existing one:</p>
<h3id="add-missing-index-for-sql-column-msgstime_iso-in-amavisd-database_1">Add missing index for SQL column <code>msgs.time_iso</code> in <code>amavisd</code> database</h3>
<p>Please run SQL commands below as MySQL root user:</p>
<pre><code>USE amavisd;
CREATE INDEX msgs_idx_time_iso ON msgs (time_iso);
<h3id="improvement-store-more-info-in-fail2ban-sql-db_1">Improvement: Store more info in Fail2ban SQL db</h3>
<divclass="admonition attention">
<pclass="admonition-title">Attention</p>
<p>Since iRedMail-1.2, Fail2ban is configured to <ahref="./fail2ban.sql.html">store banned IP addresses in
SQL database</a>, if you're running an old iRedMail
release, please upgrade your iRedMail server by following the upgrade
tutorials: <ahref="./iredmail.releases.html">iRedMail release notes and upgrade tutorials</a>.</p>
</div>
<p>With changes below, we now store matched log lines which triggerred the ban in
Fail2ban SQL database, also number of times the failure occurred in log files.</p>
<p>Please run SQL commands below as MySQL root user:</p>
<pre><code>USE fail2ban;
ALTER TABLE banned ADD COLUMN failures INT(2) NOT NULL DEFAULT 0;
ALTER TABLE banned ADD COLUMN loglines TEXT;
</code></pre>
<p>Now open file <code>/etc/fail2ban/action.d/banned_db.conf</code>, find the <code>actionban =</code>
line like below:</p>
<pre><code>actionban = /usr/local/bin/fail2ban_banned_db ban <ip><port><protocol><name>
</code></pre>
<p>Replace it by:</p>
<pre><code>actionban = /usr/local/bin/fail2ban_banned_db ban <ip><port><protocol><name><ipjailfailures><ipjailmatches>
</code></pre>
<p>Download improved shell script and replace the existing one:</p>
ALTER TABLE banned ADD COLUMN failures SMALLINT NOT NULL DEFAULT 0;
ALTER TABLE banned ADD COLUMN loglines TEXT;
</code></pre>
<ul>
<li>Open file <code>/etc/fail2ban/action.d/banned_db.conf</code>, find the <code>actionban =</code>
line like below:</li>
</ul>
<pre><code>actionban = /usr/local/bin/fail2ban_banned_db ban <ip><port><protocol><name>
</code></pre>
<p>Replace it by:</p>
<pre><code>actionban = /usr/local/bin/fail2ban_banned_db ban <ip><port><protocol><name><ipjailfailures><ipjailmatches>
</code></pre>
<ul>
<li>Download improved shell script and replace the existing one:</li>
<pstyle="text-align: center; color: grey;">All documents are available in <ahref="https://github.com/iredmail/docs/">GitHub 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://github.com/iredmail/docs/archive/master.zip">download the latest version</a> for offline reading. If you found something wrong, please do <ahref="https://www.iredmail.org/contact.html">contact us</a> to fix it.</p>
</div>
<!-- Global site tag (gtag.js) - Google Analytics -->