Update iRedMail installation with mirror site for Chinese users.

This commit is contained in:
Zhang Huangbin 2017-07-22 15:16:09 +08:00
parent f764073474
commit 545b87b05d
6 changed files with 270 additions and 14 deletions

View File

@ -0,0 +1,98 @@
# Upgrade iRedMail from 0.9.7 to 0.9.8
[TOC]
!!! warning "DO NOT APPLY THIS UPGRADE TUTORIAL"
This document is still a __DRAFT__, do NOT apply it.
!!! note "Paid Remote Upgrade Support"
We offer remote upgrade support if you don't want to get your hands dirty,
check [the details](../support.html) and [contact us](../contact.html).
## ChangeLog
## General (All backends should apply these steps)
### Update `/etc/iredmail-release` with new iRedMail version number
iRedMail stores the release version in `/etc/iredmail-release` 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:
```
0.9.7
```
### Upgrade iRedAPD (Postfix policy server) to the latest stable release (2.2)
Please follow below tutorial to upgrade iRedAPD to the latest stable release:
[Upgrade iRedAPD to the latest stable release](./upgrade.iredapd.html)
## MySQL/MariaDB backends
### Fixed: User under disabled domain is able to send email with smtp protocol
Dovecot is IMAP/POP3/Managesieve server, also a SASL auth server for Postfix.
If mail domain is disabled, users under this domain are not able to use
IMAP/POP3/Managesieve services, but there's a bug in Dovecot SQL query, it
doesn't check domain status while performing smtp sasl auth.
Please follow steps below to fix it.
* Open file `/etc/dovecot/dovecot-mysql.conf` (Linux/OpenBSD) or
`/usr/local/etc/dovecot/dovecot-mysql.conf` (FreeBSD), find the
`password_query` line like below:
```
password_query = SELECT password, allow_nets FROM mailbox WHERE username='%u' AND enable%Ls%Lc=1 AND active=1
```
* Replace it by lines below:
```
password_query = SELECT mailbox.password, mailbox.allow_nets \
FROM mailbox,domain \
WHERE mailbox.username='%u' \
AND mailbox.`enable%Ls%Lc`=1 \
AND mailbox.active=1 \
AND mailbox.domain=domain.domain \
AND domain.backupmx=0 \
AND domain.active=1
```
* Save your change and restart Dovecot service.
## PostgreSQL backend
### Fixed: User under disabled domain is able to send email with smtp protocol
Dovecot is IMAP/POP3/Managesieve server, also a SASL auth server for Postfix.
If mail domain is disabled, users under this domain are not able to use
IMAP/POP3/Managesieve services, but there's a bug in Dovecot SQL query, it
doesn't check domain status while performing smtp sasl auth.
Please follow steps below to fix it.
* Open file `/etc/dovecot/dovecot-pgsql.conf` (Linux/OpenBSD) or
`/usr/local/etc/dovecot/dovecot-pgsql.conf` (FreeBSD), find the
`password_query` line like below:
```
password_query = SELECT password, allow_nets FROM mailbox WHERE username='%u' AND enable%Ls%Lc=1 AND active=1
```
* Replace it by lines below:
```
password_query = SELECT mailbox.password, mailbox.allow_nets \
FROM mailbox,domain \
WHERE mailbox.username='%u' \
AND mailbox."enable%Ls%Lc"=1 \
AND mailbox.active=1 \
AND mailbox.domain=domain.domain \
AND domain.backupmx=0 \
AND domain.active=1
```
* Save your change and restart Dovecot service.

View File

@ -110,10 +110,17 @@ mx.example.com
<p>现在可以运行 iRedMail 安装程序了,它会问你几个简单的问题,仅此而已。</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>由于 iredmail.org 域名在国内无法访问,所以需要指定 <code>IREDMAIL_MIRROR</code> 参数使用 IP 地址。</p>
<ul>
<li>由于 iredmail.org 域名在国内无法访问,所以使用 <code>IREDMAIL_MIRROR</code> 指定
国内镜像站点。</li>
<li>由于 SOGo 网站在国内访问非常慢,且网络容易出问题,因此使用
<code>SOGO_PKG_MIRROR</code> 指定国内镜像站点。</li>
</ul>
</div>
<pre><code># cd /root/iRedMail-x.y.z/
# IREDMAIL_MIRROR='http://173.254.22.21' bash iRedMail.sh
<pre><code>cd /root/iRedMail-x.y.z/
IREDMAIL_MIRROR='https://cnmirror.iredmail.org' \
SOGO_PKG_MIRROR='https://cnmirror.iredmail.org' \
bash iRedMail.sh
</code></pre>
<h2 id="_3">安装过程的截图</h2>

View File

@ -122,12 +122,18 @@ mx.example.com
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<ul>
<li>由于 iredmail.org 域名在国内无法访问,所以需要指定 <code>IREDMAIL_MIRROR</code> 参数使用 IP 地址。</li>
<li>IREDMAIL_EPEL_MIRROR` 参数则是为了加快安装速度而选用阿里云提供的 EPEL 软件包仓库镜像。</li>
<li>由于 iredmail.org 域名在国内无法访问,所以使用 <code>IREDMAIL_MIRROR</code> 指定
国内镜像站点。</li>
<li>由于 SOGo 网站在国内访问非常慢,且网络容易出问题,因此使用
<code>SOGO_PKG_MIRROR</code> 指定国内镜像站点。</li>
<li><code>IREDMAIL_EPEL_MIRROR</code> 参数则是为了加快安装速度而选用阿里云提供的 EPEL 软件包仓库镜像。</li>
</ul>
</div>
<pre><code># cd /root/iRedMail-x.y.z/
# IREDMAIL_MIRROR='http://173.254.22.21' IREDMAIL_EPEL_MIRROR='http://mirrors.aliyun.com/epel' bash iRedMail.sh
<pre><code>cd /root/iRedMail-x.y.z/
IREDMAIL_MIRROR='https://cnmirror.iredmail.org' \
SOGO_PKG_MIRROR='https://cnmirror.iredmail.org' \
IREDMAIL_EPEL_MIRROR='http://mirrors.aliyun.com/epel' \
bash iRedMail.sh
</code></pre>
<h2 id="_3">安装过程的截图</h2>

View File

@ -0,0 +1,134 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Upgrade iRedMail from 0.9.7 to 0.9.8</title>
<link rel="stylesheet" type="text/css" href="./css/markdown.css" />
</head>
<body>
<div id="navigation">
<a href="/index.html" target="_blank">
<img alt="iRedMail web site"
src="./images/logo-iredmail.png"
style="vertical-align: middle; height: 30px;"
/>&nbsp;
<span>iRedMail</span>
</a>
&nbsp;&nbsp;//&nbsp;&nbsp;<a href="./index.html">Document Index</a></div><h1 id="upgrade-iredmail-from-097-to-098">Upgrade iRedMail from 0.9.7 to 0.9.8</h1>
<div class="toc">
<ul>
<li><a href="#upgrade-iredmail-from-097-to-098">Upgrade iRedMail from 0.9.7 to 0.9.8</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-stable-release-22">Upgrade iRedAPD (Postfix policy server) to the latest stable release (2.2)</a></li>
</ul>
</li>
<li><a href="#mysqlmariadb-backends">MySQL/MariaDB backends</a><ul>
<li><a href="#fixed-user-under-disabled-domain-is-able-to-send-email-with-smtp-protocol">Fixed: User under disabled domain is able to send email with smtp protocol</a></li>
</ul>
</li>
<li><a href="#postgresql-backend">PostgreSQL backend</a><ul>
<li><a href="#fixed-user-under-disabled-domain-is-able-to-send-email-with-smtp-protocol_1">Fixed: User under disabled domain is able to send email with smtp protocol</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="admonition warning">
<p class="admonition-title">DO NOT APPLY THIS UPGRADE TUTORIAL</p>
<p>This document is still a <strong>DRAFT</strong>, do NOT apply it.</p>
</div>
<div class="admonition note">
<p class="admonition-title">Paid Remote Upgrade Support</p>
<p>We offer remote upgrade support if you don't want to get your hands dirty,
check <a href="../support.html">the details</a> and <a href="../contact.html">contact us</a>.</p>
</div>
<h2 id="changelog">ChangeLog</h2>
<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>0.9.7
</code></pre>
<h3 id="upgrade-iredapd-postfix-policy-server-to-the-latest-stable-release-22">Upgrade iRedAPD (Postfix policy server) to the latest stable release (2.2)</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>
<h2 id="mysqlmariadb-backends">MySQL/MariaDB backends</h2>
<h3 id="fixed-user-under-disabled-domain-is-able-to-send-email-with-smtp-protocol">Fixed: User under disabled domain is able to send email with smtp protocol</h3>
<p>Dovecot is IMAP/POP3/Managesieve server, also a SASL auth server for Postfix.
If mail domain is disabled, users under this domain are not able to use
IMAP/POP3/Managesieve services, but there's a bug in Dovecot SQL query, it
doesn't check domain status while performing smtp sasl auth.
Please follow steps below to fix it.</p>
<ul>
<li>Open file <code>/etc/dovecot/dovecot-mysql.conf</code> (Linux/OpenBSD) or
<code>/usr/local/etc/dovecot/dovecot-mysql.conf</code> (FreeBSD), find the
<code>password_query</code> line like below:</li>
</ul>
<pre><code>password_query = SELECT password, allow_nets FROM mailbox WHERE username='%u' AND enable%Ls%Lc=1 AND active=1
</code></pre>
<ul>
<li>Replace it by lines below:</li>
</ul>
<pre><code>password_query = SELECT mailbox.password, mailbox.allow_nets \
FROM mailbox,domain \
WHERE mailbox.username='%u' \
AND mailbox.`enable%Ls%Lc`=1 \
AND mailbox.active=1 \
AND mailbox.domain=domain.domain \
AND domain.backupmx=0 \
AND domain.active=1
</code></pre>
<ul>
<li>Save your change and restart Dovecot service.</li>
</ul>
<h2 id="postgresql-backend">PostgreSQL backend</h2>
<h3 id="fixed-user-under-disabled-domain-is-able-to-send-email-with-smtp-protocol_1">Fixed: User under disabled domain is able to send email with smtp protocol</h3>
<p>Dovecot is IMAP/POP3/Managesieve server, also a SASL auth server for Postfix.
If mail domain is disabled, users under this domain are not able to use
IMAP/POP3/Managesieve services, but there's a bug in Dovecot SQL query, it
doesn't check domain status while performing smtp sasl auth.
Please follow steps below to fix it.</p>
<ul>
<li>Open file <code>/etc/dovecot/dovecot-pgsql.conf</code> (Linux/OpenBSD) or
<code>/usr/local/etc/dovecot/dovecot-pgsql.conf</code> (FreeBSD), find the
<code>password_query</code> line like below:</li>
</ul>
<pre><code>password_query = SELECT password, allow_nets FROM mailbox WHERE username='%u' AND enable%Ls%Lc=1 AND active=1
</code></pre>
<ul>
<li>Replace it by lines below:</li>
</ul>
<pre><code>password_query = SELECT mailbox.password, mailbox.allow_nets \
FROM mailbox,domain \
WHERE mailbox.username='%u' \
AND mailbox.&quot;enable%Ls%Lc&quot;=1 \
AND mailbox.active=1 \
AND mailbox.domain=domain.domain \
AND domain.backupmx=0 \
AND domain.active=1
</code></pre>
<ul>
<li>Save your change and restart Dovecot service.</li>
</ul><div class="footer">
<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. You can <a href="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 <a href="http://www.iredmail.org/contact.html">contact us</a> to fix it.</p>
</div>
<script type="text/javascript">
(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>

View File

@ -84,11 +84,16 @@ mx.example.com
!!! warning
由于 iredmail.org 域名在国内无法访问,所以需要指定 `IREDMAIL_MIRROR` 参数使用 IP 地址。
* 由于 iredmail.org 域名在国内无法访问,所以使用 `IREDMAIL_MIRROR` 指定
国内镜像站点。
* 由于 SOGo 网站在国内访问非常慢,且网络容易出问题,因此使用
`SOGO_PKG_MIRROR` 指定国内镜像站点。
```
# cd /root/iRedMail-x.y.z/
# IREDMAIL_MIRROR='http://173.254.22.21' bash iRedMail.sh
cd /root/iRedMail-x.y.z/
IREDMAIL_MIRROR='https://cnmirror.iredmail.org' \
SOGO_PKG_MIRROR='https://cnmirror.iredmail.org' \
bash iRedMail.sh
```
## 安装过程的截图

View File

@ -101,12 +101,18 @@ SELINUX=permissive
!!! warning
* 由于 iredmail.org 域名在国内无法访问,所以需要指定 `IREDMAIL_MIRROR` 参数使用 IP 地址。
* IREDMAIL_EPEL_MIRROR` 参数则是为了加快安装速度而选用阿里云提供的 EPEL 软件包仓库镜像。
* 由于 iredmail.org 域名在国内无法访问,所以使用 `IREDMAIL_MIRROR` 指定
国内镜像站点。
* 由于 SOGo 网站在国内访问非常慢,且网络容易出问题,因此使用
`SOGO_PKG_MIRROR` 指定国内镜像站点。
* `IREDMAIL_EPEL_MIRROR` 参数则是为了加快安装速度而选用阿里云提供的 EPEL 软件包仓库镜像。
```
# cd /root/iRedMail-x.y.z/
# IREDMAIL_MIRROR='http://173.254.22.21' IREDMAIL_EPEL_MIRROR='http://mirrors.aliyun.com/epel' bash iRedMail.sh
cd /root/iRedMail-x.y.z/
IREDMAIL_MIRROR='https://cnmirror.iredmail.org' \
SOGO_PKG_MIRROR='https://cnmirror.iredmail.org' \
IREDMAIL_EPEL_MIRROR='http://mirrors.aliyun.com/epel' \
bash iRedMail.sh
```
## 安装过程的截图