4 new Chinese translations.

This commit is contained in:
Zhang Huangbin 2015-08-14 21:25:15 +08:00
parent cbaa9c2265
commit b686b001ba
16 changed files with 422 additions and 68 deletions

View File

@ -1,5 +1,7 @@
# TODO
* `convert.sh`: Indicate document is available in other language in article page.
* http://doc.samplezone.ch/iredmail/version-0-9-1/programs/program-sockets/
* http://doc.samplezone.ch/iredmail/

View File

@ -19,9 +19,12 @@ a cache DNS server in LAN or localhost helps a lot:
* [Enable postscreen service](./enable.postscreen.html)
If you don't want to use postscreen service, you can [enable DNSBL service](./enable.dnsbl.html)
instead, it helps a lot too, but less effective than postscreen service.
instead, it helps a lot too. Although both `postscreen` and pure DNSBL services
uses the same DNSBL servers, but `postscreen` offers additional solutions to
reduce spam, so postscreen is better.
postscreen and DNSBL service help catch a lot spam, save much system resource.
postscreen and DNSBL service help catch a lot spam before putting the spams
in local mail queue, so they save much system resource.
### Update Amavisd + Postfix config files to process more emails concurrently

View File

@ -4,9 +4,8 @@ Per-user mailbox quota rule is defined in Dovecot, in one of below files:
* `/etc/dovecot/dovecot-mysql.conf`: MySQL backend
* `/etc/dovecot/dovecot-pgsql.conf`: PostgreSQL backend
* `/etc/dovecot/dovecot-mysql.conf`: MySQL backend
If no per-user quota rules found, Dovecot will use 'quota_rule[X]' defined in
If no per-user quota rules found, Dovecot will use `quota_rule[X]` defined in
`/etc/dovecot/dovecot.conf`. For example:
```
@ -36,7 +35,7 @@ plugin {
quota = dict:user::proxy::quotadict
quota_rule = *:storage=1G
quota_rule2 = Trash:ignore
quota_rule2 = Trash:ignore # <-- new quota rule, ignore Trash folder
...
}
@ -51,6 +50,6 @@ user_attrs = ...,mailQuota=quota_rule=*:bytes=%$,=quota_rule2=Trash:ignore
# File: /etc/dovecot/dovecot-mysql.conf, or dovecot-pgsql.conf
user_query = SELECT ... \
CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule \
'Trash:ignore' AS quota_rule2 \
'Trash:ignore' AS quota_rule2 \ -- New quota rule, ignore Trash folder
FROM ...
```

View File

@ -45,7 +45,7 @@ certificate:
* `A challenge password []`: type a password for this ssl certificate.
* `An optional company name []`: an optional company name.
NOTE: Some certificates can only be used on web servers using the `Common Name`
__NOTE__: Some certificates can only be used on web servers using the `Common Name`
specified during enrollment. For example, a certificate for the domain
`domain.com` will receive a warning if accessing a site named `www.domain.com`
or `secure.domain.com`, because `www.domain.com` and `secure.domain.com` are
@ -72,7 +72,7 @@ store them in any directory you like, recommended directories are:
## Configure Postfix/Dovecot/Apache/Nginx to use bought SSL certificate
We use CentOS for example in below tutorial, please adjust the file to correct
one on your server.
one on your server according to above description.
### Postfix (SMTP server)

View File

@ -15,9 +15,8 @@
<ul>
<li><code>/etc/dovecot/dovecot-mysql.conf</code>: MySQL backend</li>
<li><code>/etc/dovecot/dovecot-pgsql.conf</code>: PostgreSQL backend</li>
<li><code>/etc/dovecot/dovecot-mysql.conf</code>: MySQL backend</li>
</ul>
<p>If no per-user quota rules found, Dovecot will use 'quota_rule[X]' defined in
<p>If no per-user quota rules found, Dovecot will use <code>quota_rule[X]</code> defined in
<code>/etc/dovecot/dovecot.conf</code>. For example:</p>
<pre><code># File: /etc/dovecot/dovecot.conf
@ -44,7 +43,7 @@ plugin {
quota = dict:user::proxy::quotadict
quota_rule = *:storage=1G
quota_rule2 = Trash:ignore
quota_rule2 = Trash:ignore # &lt;-- new quota rule, ignore Trash folder
...
}
@ -59,7 +58,7 @@ user_attrs = ...,mailQuota=quota_rule=*:bytes=%$,=quota_rule2=Trash:ignore
# File: /etc/dovecot/dovecot-mysql.conf, or dovecot-pgsql.conf
user_query = SELECT ... \
CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule \
'Trash:ignore' AS quota_rule2 \
'Trash:ignore' AS quota_rule2 \ -- New quota rule, ignore Trash folder
FROM ...
</code></pre><p style="text-align: center; color: grey;">Document published under a <a href="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 <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(){

View File

@ -36,8 +36,11 @@ a cache DNS server in LAN or localhost helps a lot:</p>
<li><a href="./enable.postscreen.html">Enable postscreen service</a></li>
</ul>
<p>If you don't want to use postscreen service, you can <a href="./enable.dnsbl.html">enable DNSBL service</a>
instead, it helps a lot too, but less effective than postscreen service.</p>
<p>postscreen and DNSBL service help catch a lot spam, save much system resource.</p>
instead, it helps a lot too. Although both <code>postscreen</code> and pure DNSBL services
uses the same DNSBL servers, but <code>postscreen</code> offers additional solutions to
reduce spam, so postscreen is better.</p>
<p>postscreen and DNSBL service help catch a lot spam before putting the spams
in local mail queue, so they save much system resource.</p>
<h3 id="update-amavisd-postfix-config-files-to-process-more-emails-concurrently">Update Amavisd + Postfix config files to process more emails concurrently</h3>
<ul>
<li><a href="./concurrent.processing.html">Process more emails concurrently</a></li>

View File

@ -67,7 +67,7 @@ certificate:</p>
<li><code>A challenge password []</code>: type a password for this ssl certificate.</li>
<li><code>An optional company name []</code>: an optional company name.</li>
</ul>
<p>NOTE: Some certificates can only be used on web servers using the <code>Common Name</code>
<p><strong>NOTE</strong>: Some certificates can only be used on web servers using the <code>Common Name</code>
specified during enrollment. For example, a certificate for the domain
<code>domain.com</code> will receive a warning if accessing a site named <code>www.domain.com</code>
or <code>secure.domain.com</code>, because <code>www.domain.com</code> and <code>secure.domain.com</code> are
@ -91,7 +91,7 @@ store them in any directory you like, recommended directories are:</p>
</ul>
<h2 id="configure-postfixdovecotapachenginx-to-use-bought-ssl-certificate">Configure Postfix/Dovecot/Apache/Nginx to use bought SSL certificate</h2>
<p>We use CentOS for example in below tutorial, please adjust the file to correct
one on your server.</p>
one on your server according to above description.</p>
<h3 id="postfix-smtp-server">Postfix (SMTP server)</h3>
<p>We can use <code>postconf</code> command to update SSL related settings directly:</p>
<pre><code>postconf -e smtpd_use_tls='yes'

View File

@ -0,0 +1,31 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>禁用 Clubbringer 提供的灰名单服务</title>
<link rel="stylesheet" type="text/css" href="../css/markdown.css" />
</head>
<body>
<div id="navigation">
<a href="http://www.iredmail.org" target="_blank">iRedMail web site</a>
// <a href="./index.html">Document Index</a>
</div><h1 id="clubbringer">禁用 Clubbringer 提供的灰名单服务</h1>
<ul>
<li>先查阅文档来确认 Cluebringer 配置文件 <code>cluebringer.conf</code> 的具体路径:<a href="./file.locations.html#cluebringer">iRedMail 主要组件的配置文件和日志文件路径</a></li>
<li>在配置文件 <code>cluebringer.conf</code> 中查找以下行:</li>
</ul>
<pre><code>[Greylisting]
enable=1
</code></pre>
<p>要禁用灰名单,把 <code>enabled=1</code> 改为 <code>enabled=0</code>,并重启 Cluebringer 服务即可。</p><p style="text-align: center; color: grey;">Document published under a <a href="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 <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>

View File

@ -0,0 +1,76 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>在邮箱配额中忽略垃圾箱目录</title>
<link rel="stylesheet" type="text/css" href="../css/markdown.css" />
</head>
<body>
<div id="navigation">
<a href="http://www.iredmail.org" target="_blank">iRedMail web site</a>
// <a href="./index.html">Document Index</a>
</div><h1 id="_1">在邮箱配额中忽略垃圾箱目录</h1>
<p>在 Dovecot 中,针对单个用户的邮箱配额限制定义在下列文件之一:</p>
<ul>
<li><code>/etc/dovecot/dovecot-mysql.conf</code>: MySQL 后端</li>
<li><code>/etc/dovecot/dovecot-pgsql.conf</code>: PostgreSQL 后端</li>
</ul>
<p>如果没有针对单个用户的邮箱配额限制Dovecot 将使用 <code>/etc/dovecot/dovecot.conf</code>
文件中的 <code>quota_rule[X]</code> 设置。例如:</p>
<pre><code># File: /etc/dovecot/dovecot.conf
plugin {
quota = dict:user::proxy::quotadict
quota_rule = *:storage=1G
#quota_rule2 = *:messages=0
#quota_rule3 = Trash:storage=1G
#quota_rule4 = Junk:ignore
...
}
</code></pre>
<p>因此,要忽略 <code>Trash</code> 目录的邮箱容量,可以在 <code>/etc/dovecot/dovecot.conf</code>
<code>/etc/dovecot/dovecot-{mysql,pgsql,ldap}.conf</code> 中增加新的配额规则quota_rule</p>
<ul>
<li>配置示例 1</li>
</ul>
<pre><code># File: /etc/dovecot/dovecot.conf
plugin {
quota = dict:user::proxy::quotadict
quota_rule = *:storage=1G
quota_rule2 = Trash:ignore # &lt;- 新配额规则:忽略 Trash 目录
...
}
</code></pre>
<ul>
<li>配置示例 2:</li>
</ul>
<p>OpenLDAP 后端:</p>
<pre><code># File: /etc/dovecot/dovecot-ldap.conf
user_attrs = ...,mailQuota=quota_rule=*:bytes=%$,=quota_rule2=Trash:ignore
</code></pre>
<p>MySQL 或 PostgreSQL 后端:</p>
<h1 id="file-etcdovecotdovecot-mysqlconf-or-dovecot-pgsqlconf">File: /etc/dovecot/dovecot-mysql.conf, or dovecot-pgsql.conf</h1>
<p>user_query = SELECT ... \
CONCAT('<em>:bytes=', mailbox.quota</em>1048576) AS quota_rule \
'Trash:ignore' AS quota_rule2 \ -- 新配额规则:忽略 Trash 目录
FROM ...
```</p><p style="text-align: center; color: grey;">Document published under a <a href="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 <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>

View File

@ -11,6 +11,9 @@
</div><h3 id="how-to">How to</h3>
<ul>
<li><a href="change.mail.attachment.size.html">修改邮件附件大小</a></li>
<li><a href="disable.greylisting.html">禁用 Clubbringer 提供的灰名单服务</a></li>
<li><a href="ignore.trash.folder.in.quota.html">在邮箱配额中忽略垃圾箱目录</a></li>
<li><a href="use.a.bought.ssl.certificate.html">使用购买的 SSL 证书</a></li>
</ul>
<h3 id="_1">排错与调试</h3>
<ul>

View File

@ -0,0 +1,56 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>性能优化</title>
<link rel="stylesheet" type="text/css" href="../css/markdown.css" />
</head>
<body>
<div id="navigation">
<a href="http://www.iredmail.org" target="_blank">iRedMail web site</a>
// <a href="./index.html">Document Index</a>
</div><h1 id="_1">性能优化</h1>
<div class="toc">
<ul>
<li><a href="#_1">性能优化</a><ul>
<li><a href="#dns">在局域网或本机上搭建一个 DNS 缓存服务器</a></li>
<li><a href="#postscreen">启用 postscreen 服务以帮助减少垃圾邮件</a></li>
<li><a href="#amavisd-postfix">更改 Amavisd + Postfix 的配置文件以便同时处理更多的邮件</a></li>
</ul>
</li>
</ul>
</div>
<p>如果你运行的是一台高负载的邮件服务器(每天都需要处理大量的收发件请求),可以
参考下面建议调整服务器以达到更好的性能。</p>
<h3 id="dns">在局域网或本机上搭建一个 DNS 缓存服务器</h3>
<p>邮件服务需要频繁、大量地执行 DNS 查询,所以非常依赖 DNS 服务。因此在局域网或
本机搭建 DNS 缓存服务器将有以下好处:</p>
<ul>
<li>加快 DNS 查询,这对邮件的流转起到极大加速作用。</li>
<li>极大地减少了对 DNSBL 服务器的查询请求。这可以确保在不超出服务商的查询
次数限制的前提下,稳定地使用 DNSBL 服务。</li>
</ul>
<h3 id="postscreen">启用 postscreen 服务以帮助减少垃圾邮件</h3>
<ul>
<li><a href="./enable.postscreen.html">启用 postscreen 服务</a></li>
</ul>
<p>如果你不想启用 postscreen 服务,可以尝试 <a href="./enable.dnsbl.html">启用 DNSBL 服务</a>
作为替代,它同样能极大地减少垃圾邮件。虽然 postscreen 和单纯的 DNSBL 服务都
使用相同的 DNSBL 服务商,但 postscreen 有额外的机制来帮助阻挡垃圾邮件,因此
postscreen 有更好的反垃圾效果。</p>
<p>postscreen 和 DNSBL 服务都在 smtp 会话阶段就拦下垃圾邮件,因此可以极大地节省
系统资源。</p>
<h3 id="amavisd-postfix">更改 Amavisd + Postfix 的配置文件以便同时处理更多的邮件</h3>
<ul>
<li><a href="./concurrent.processing.html">同时处理更多邮件</a></li>
</ul><p style="text-align: center; color: grey;">Document published under a <a href="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 <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>

View File

@ -0,0 +1,157 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>使用购买的 SSL 证书</title>
<link rel="stylesheet" type="text/css" href="../css/markdown.css" />
</head>
<body>
<div id="navigation">
<a href="http://www.iredmail.org" target="_blank">iRedMail web site</a>
// <a href="./index.html">Document Index</a>
</div><h1 id="ssl">使用购买的 SSL 证书</h1>
<div class="toc">
<ul>
<li><a href="#ssl">使用购买的 SSL 证书</a><ul>
<li><a href="#ssl-ssl">生成 SSL 密钥并购买 SSL 证书</a></li>
<li><a href="#postfixdovecotapachenginx-ssl">配置 Postfix/Dovecot/Apache/Nginx 使用购买的 SSL 证书</a><ul>
<li><a href="#postfix-smtp">Postfix (SMTP 服务器)</a></li>
<li><a href="#dovecot-pop3imap">Dovecot (POP3/IMAP 服务器)</a></li>
<li><a href="#apache">Apache 网页服务器</a></li>
<li><a href="#nginx">Nginx (网页服务器)</a></li>
</ul>
</li>
<li><a href="#_1">参考资料</a></li>
</ul>
</li>
</ul>
</div>
<p>iRedMail 在安装期间会自动生成一个自签名的 SSL 证书,如果你只是要确保有安全的
网络服务(如基于 SSL/TLS 之上的 POP3/IMAP/SMTP 服务),该证书足以。但某些邮件
客户端或浏览器会弹出一个烦人的警示框,提示你该证书不受信任。为了避免这种提示,
必须从 SSL 证书供应商那里购买 SSL 证书。在 Google 中搜索 <code>buy ssl certificate</code>
会列出许多 SSL 证书供应商,选择你信任的那一家即可。</p>
<blockquote>
<p><a href="http://www.startssl.com/?app=1">StartSSL.com 提供免费的一年期 SSL 证书</a>.</p>
</blockquote>
<h2 id="ssl-ssl">生成 SSL 密钥并购买 SSL 证书</h2>
<p>首先,你需要在服务器上使用 <code>openssl</code> 命令生成一个新的 SSL 证书。<strong>警告</strong> :请
__不要__使用长度小于 2048 位的密钥,那是不安全的。</p>
<pre><code># openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr
</code></pre>
<p>该命令会生成两个文件:</p>
<ul>
<li><code>server.key</code>:密钥文件。可用于解密 SSL 证书。必须保护好这个文件。</li>
<li><code>server.csr</code>:用于申请证书的前面请求文件。<strong>购买 SSL 证书时服务商需要此文件。</strong></li>
</ul>
<p>openssl 命令会依据 X.509 规范的要求提示输入凭据信息:</p>
<ul>
<li><code>Country Name (2 letter code)</code>: 使用两个不带标点符号的字母来表示国别。例如: USCACN。</li>
<li><code>State or Province Name (full name)</code>: 地区或省份全称。例如California。</li>
<li><code>Locality Name (eg, city)</code>: 城市或城镇名称。例如Berkeley。</li>
<li><code>Organization Name (eg, company)</code>: 组织名、公司名。</li>
<li><code>Organizational Unit Name (eg, section)</code>: 申请此凭据的部门或单位。</li>
<li><code>Common Name (e.g. server FQDN or YOUR name)</code>: 服务器域名或申请人名字。</li>
<li><code>Email Address []</code>: 申请人邮箱地址。</li>
<li><code>A challenge password []</code>: 为该 SSL 证书设置一个密码。</li>
<li><code>An optional company name []</code>: 一个可选的备用公司名。</li>
</ul>
<p><strong>注意</strong>:有一些 web 服务器只能识别 <code>Common Name</code> 里指定的服务器地址。例如,使用为
<code>domain.com</code> 申请的证书,用户在访问 <code>www.domain.com</code> 或者 <code>secure.domain.com</code>
的网页时,会被警告当前网站使用的证书不可信,因为 <code>www.domain.com</code>
<code>secure.domain.com</code> 与证书的域名 <code>domain.com</code> 是不同的。</p>
<p>现在有了 <code>server.key</code><code>server.csr</code> 两个文件,前往选定的 SSL 证书供应商
的网站购买证书,它会要求你上传 <code>server.csr</code> 文件或输入该文件的内容,然后就可以
获得签发的 SSL 证书了。</p>
<p>通常情况下, SSL 服务提供商将会给你两个文件:</p>
<ul>
<li>server.crt</li>
<li>server.ca-bundle</li>
</ul>
<p>我们需要着两个文件,以前之前生成的 <code>server.key</code>。将它们上传到服务器,以下是
推荐的存放路径:</p>
<ul>
<li>在 RHEL/CentOS 系统上:<code>server.crt</code><code>server.ca-bundle</code> 上传至
<code>/etc/pki/tls/certs/</code> <code>server.key</code> 上传至 <code>/etc/pki/tls/private/</code></li>
<li>在 Debian/Ubuntu FreeBSD 系统上: <code>server.crt</code><code>server.ca-bundle</code> 上传至
<code>/etc/ssl/certs/</code> <code>server.key</code> 上传至<code>/etc/ssl/private/</code></li>
<li>在 OpenBSD 系统上:上传至 <code>/etc/ssl/</code></li>
</ul>
<h2 id="postfixdovecotapachenginx-ssl">配置 Postfix/Dovecot/Apache/Nginx 使用购买的 SSL 证书</h2>
<p>下面示例中我们以 CentOS 系统为例,请根据你的发行版调整相关文件路径(已在上面注明)。</p>
<h3 id="postfix-smtp">Postfix (SMTP 服务器)</h3>
<p>直接使用 <code>postconf</code> 命令来更新 SSL 证书相关的设置:</p>
<pre><code>postconf -e smtpd_use_tls='yes'
postconf -e smtpd_tls_cert_file='/etc/pki/tls/certs/server.crt'
postconf -e smtpd_tls_key_file='/etc/pki/tls/private/server.key'
postconf -e smtpd_tls_CAfile='/etc/pki/tls/certs/server.ca-bundle'
</code></pre>
<p>修改后需重启 Postfix 服务。</p>
<h3 id="dovecot-pop3imap">Dovecot (POP3/IMAP 服务器)</h3>
<p>Dovecot 的 SSL 证书设置定义在主配置文件 <code>/etc/dovecot/dovecot.conf</code>
(Linux/OpenBSD) 或 <code>/usr/local/etc/dovecot/dovecot.conf</code> (FreeBSD) 里:</p>
<pre><code>ssl = required
ssl_cert = &lt;/etc/pki/tls/certs/server.crt
ssl_key = &lt;/etc/pki/tls/private/server.key
ssl_ca = &lt;/etc/pki/tls/certs/server.ca-bundle
</code></pre>
<p>修改后需重启 Dovecot 服务。</p>
<h3 id="apache">Apache 网页服务器</h3>
<ul>
<li>在 RHEL/CentOS 系统上,配置文件为 <code>/etc/httpd/conf.d/ssl.conf</code></li>
<li>在 Debian/Ubuntu 系统上,配置文件为 <code>/etc/apache2/sites-available/default-ssl</code>
(或者是 <code>default-ssl.conf</code> </li>
<li>在 FreeBSD 系统上,配置文件为 <code>/usr/local/etc/apache24/extra/httpd-ssl.conf</code> 。注意:取决于运行的 Apache 版本,右侧路径会有所不同(<code>apache24</code> 将会是 <code>apache[_version_]</code> )。</li>
<li>在 OpenBSD 系统,如果是 OpenBSD 5.5 或更早的版本,配置文件为 <code>/var/www/conf/httpd.conf</code> 。注意: OpenBSD 5.6 以及之后的版本不再装置 Apache 。</li>
</ul>
<p>示例:</p>
<pre><code>SSLCertificateFile /etc/pki/tls/certs/server.crt
SSLCertificateKeyFile /etc/pki/tls/private/server.key
SSLCertificateChainFile /etc/pki/tls/certs/server.ca-bundle
</code></pre>
<p>修改后需重启 Apache 服务。</p>
<h3 id="nginx">Nginx (网页服务器)</h3>
<ul>
<li>在 Linux 和 OpenBSD 系统上, 配置文件为 <code>/etc/nginx/conf.d/default.conf</code></li>
<li>在 FreeBSD 系统上,配置文件为 <code>/usr/local/etc/nginx/conf.d/default.conf</code></li>
</ul>
<pre><code>server {
listen 443;
...
ssl on;
ssl_certificate /etc/pki/tls/certs/server.crt;
ssl_certificate_key /etc/pki/tls/private/server.key;
...
}
</code></pre>
<p>大部分浏览器能识别 SSL 证书,但可能有小部分浏览器无法正确识别。这种情况可以
<code>server.crt</code><code>server.ca-bundle</code> 的内容追加到一个新文件里,然后以这个
新文件作为 SSL 证书。注意:<code>server.crt</code> 的内容要在前面。</p>
<pre><code># cd /etc/pki/tls/certs/
# cat server.crt server.ca-bundle &gt; server.chained.crt
</code></pre>
<p>更新 <code>/etc/nginx/conf.d/default.conf</code> 文件中的 <code>ssl_certificate</code> 参数:</p>
<pre><code> ssl_certificate /etc/pki/tls/certs/server.chained.crt;
</code></pre>
<p>修改后需重启 Nginx 服务。</p>
<h2 id="_1">参考资料</h2>
<ul>
<li><a href="http://nginx.org/en/docs/http/configuring_https_servers.html">HTTPS 服务器配置</a></li>
</ul><p style="text-align: center; color: grey;">Document published under a <a href="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 <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>

View File

@ -2,24 +2,30 @@
[TOC]
如果你运行的是一台高负载的邮件服务器(每天都需要处理大量的收发件请求),可以跟随以下列明的指南操作以使服务器有更好的性能。
如果你运行的是一台高负载的邮件服务器(每天都需要处理大量的收发件请求),可以
参考下面建议调整服务器以达到更好的性能。
### 在局域网或本地主机上设置一个 DNS 解析的缓存
### 在局域网或本机上搭建一个 DNS 缓存服务器
邮件服务器的运行严重依赖 DNS 服务,它频繁的执行 DNS 解析请求,一个位于局域网或本地主机上的 DNS 缓存将助益良多:
邮件服务需要频繁、大量地执行 DNS 查询,所以非常依赖 DNS 服务。因此在局域网或
本机搭建 DNS 缓存服务器将有以下好处:
* 它将加速邮件服务器对 DNS 解析队列的处理。
* 它能减少 DNS 解析对 DNSBL 服务的请求次数,这样你在享受同样优质服务的同时,能有效避免出现超出解析上限的问题。
* 加快 DNS 查询,这对邮件的流转起到极大加速作用。
* 极大地减少了对 DNSBL 服务器的查询请求。这可以确保在不超出服务商的查询
次数限制的前提下,稳定地使用 DNSBL 服务。
### 启用 postscreen 服务帮助减少垃圾邮件
### 启用 postscreen 服务帮助减少垃圾邮件
* [启用 postscreen 服务](./enable.postscreen.html)
如果你不想启用 postscreen 服务,可以尝试 [启用 DNSBL 服务](./enable.dnsbl.html)
来替代,该服务同样对邮件服务助益良多,但是效率略低于 postscreen 服务。
作为替代,它同样能极大地减少垃圾邮件。虽然 postscreen 和单纯的 DNSBL 服务都
使用相同的 DNSBL 服务商,但 postscreen 有额外的机制来帮助阻挡垃圾邮件,因此
postscreen 有更好的反垃圾效果。
postscreen 和 DNSBL 服务在帮助拦截大量垃圾邮件的同时节省了大量的服务器资源。
postscreen 和 DNSBL 服务都在 smtp 会话阶段就拦下垃圾邮件,因此可以极大地节省
系统资源。
### 更改 Amavisd + Postfix 的配置文件以便同时处理更多的邮件
### 更改 Amavisd + Postfix 的配置文件以便同时处理更多的邮件
* [同时处理更多邮件](./concurrent.processing.html)

View File

@ -1,7 +1,6 @@
# 禁用 Clubbringer 灰名单
* 通过查阅后方教程来确认 Cluebringer 配置文件 `cluebringer.conf` 的所在路径: [iRedMail 主要组件的配置文件和日志文件路径](./file.locations.html#cluebringer)
# 禁用 Clubbringer 提供的灰名单服务
* 先查阅文档来确认 Cluebringer 配置文件 `cluebringer.conf` 的具体路径:[iRedMail 主要组件的配置文件和日志文件路径](./file.locations.html#cluebringer)
* 在配置文件 `cluebringer.conf` 中查找以下行:
```
@ -9,4 +8,4 @@
enable=1
```
要禁用灰名单,把 `enabled=1` 改为 `enabled=0` 即可,之后重启 Cluebringer 服务
要禁用灰名单,把 `enabled=1` 改为 `enabled=0`,并重启 Cluebringer 服务即可

View File

@ -1,11 +1,12 @@
# 在邮箱配额中忽略垃圾箱目录
在 Dovecot 中针对单个用户的邮箱配额规格是由以下列明的其中一个配置文件决定的
在 Dovecot 中,针对单个用户的邮箱配额限制定义在下列文件之一
* `/etc/dovecot/dovecot-mysql.conf`: MySQL 后
* `/etc/dovecot/dovecot-pgsql.conf`: PostgreSQL 后
* `/etc/dovecot/dovecot-mysql.conf`: MySQL 后
* `/etc/dovecot/dovecot-pgsql.conf`: PostgreSQL 后
如果没有找到针对单个用户的邮箱配额文件, Dovecot 将会调用 `/etc/dovecot/dovecot.conf` 文件中的 'quota_rule[X]' 参数来替代,例如:
如果没有针对单个用户的邮箱配额限制Dovecot 将使用 `/etc/dovecot/dovecot.conf`
文件中的 `quota_rule[X]` 设置。例如:
```
# File: /etc/dovecot/dovecot.conf
@ -22,9 +23,10 @@ plugin {
}
```
因此,要忽略配额中的 `Trash` 目录,你可以在 `/etc/dovecot/dovecot.conf` 或者 `/etc/dovecot/dovecot-{mysql,pgsql,ldap}.conf` 中增加新的配额规则quota_rule
因此,要忽略 `Trash` 目录的邮箱容量,可以在 `/etc/dovecot/dovecot.conf`
`/etc/dovecot/dovecot-{mysql,pgsql,ldap}.conf` 中增加新的配额规则quota_rule
* 配置示例 #1:
* 配置示例 1
```
# File: /etc/dovecot/dovecot.conf
@ -33,21 +35,25 @@ plugin {
quota = dict:user::proxy::quotadict
quota_rule = *:storage=1G
quota_rule2 = Trash:ignore
quota_rule2 = Trash:ignore # <- 新配额规则忽略 Trash 目录
...
}
```
* 配置示例 #2:
* 配置示例 2:
OpenLDAP 后端:
```
# File: /etc/dovecot/dovecot-ldap.conf
user_attrs = ...,mailQuota=quota_rule=*:bytes=%$,=quota_rule2=Trash:ignore
user_attrs = ...,mailQuota=quota_rule=*:bytes=%$,=quota_rule2=Trash:ignore
```
MySQL 或 PostgreSQL 后端:
# File: /etc/dovecot/dovecot-mysql.conf, or dovecot-pgsql.conf
user_query = SELECT ... \
CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule \
'Trash:ignore' AS quota_rule2 \
'Trash:ignore' AS quota_rule2 \ -- 新配额规则:忽略 Trash 目录
FROM ...
```

View File

@ -1,57 +1,71 @@
# 使用购买的 SSL 凭据
# 使用购买的 SSL 证书
[TOC]
iRedMail 在安装期间会自动生成一个自签名的 SSL 凭据该凭据可以有效保护网络链接的安全POP3/IMAP/SMTP 基于 TLS, HTTPS。但是某些邮件客户端或浏览器会弹出一个烦人警示此链接不受信任。为了避免这种提示需要从 SSL 凭据服务提供商处购买 SSL凭据。在 Google 中搜索 “buy ssl certificate” ,可以搜索到许多 SSL 凭据服务提供商,选择一个你认为靠谱即可。
iRedMail 在安装期间会自动生成一个自签名的 SSL 证书,如果你只是要确保有安全的
网络服务(如基于 SSL/TLS 之上的 POP3/IMAP/SMTP 服务),该证书足以。但某些邮件
客户端或浏览器会弹出一个烦人的警示框,提示你该证书不受信任。为了避免这种提示,
必须从 SSL 证书供应商那里购买 SSL 证书。在 Google 中搜索 `buy ssl certificate`
会列出许多 SSL 证书供应商,选择你信任的那一家即可。
> [StartSSL.com 提供免费的一年期 SSL 凭据](http://www.startssl.com/?app=1).
> [StartSSL.com 提供免费的一年期 SSL 证书](http://www.startssl.com/?app=1).
## 生成 SSL 私钥以及购买 SSL 凭据
## 生成 SSL 密钥并购买 SSL 证书
首先,在服务器上使用 `openssl` 命令来生成一个新的 SSL 凭据。 __警告__ 请【不要】使用长度小于2048位的密钥那是不安全的。
首先,你需要在服务器上使用 `openssl` 命令生成一个新的 SSL 证书。__警告__ :请
__不要__使用长度小于 2048 位的密钥,那是不安全的。
```
# openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr
```
该命令的结果是将产生两个文件:
该命令会生成两个文件:
* `server.key`: 一个描述你的 SSL 凭据的私钥文件the private key for the decryption of your SSL certificate.
* `server.csr`: CSR证书签名请求文件是用来验证你的 SSL 凭据的。 __SSL 凭据服务提供商需要此文件。__
* `server.key`:密钥文件。可用于解密 SSL 证书。必须保护好这个文件。
* `server.csr`用于申请证书的前面请求文件。__购买 SSL 证书时服务商需要此文件。__
openssl 命令会依据 X.509 规范的要求提示输入凭据信息:
* `Country Name (2 letter code)`: 使用两个不带标点符号的字母来表示国别。例如: USCACN。
* `State or Province Name (full name)`: 地区或省份全称。例如: California。
* `Locality Name (eg, city)`: 城市或城镇名称。例如: Berkeley.
* `State or Province Name (full name)`: 地区或省份全称。例如California。
* `Locality Name (eg, city)`: 城市或城镇名称。例如:Berkeley。
* `Organization Name (eg, company)`: 组织名、公司名。
* `Organizational Unit Name (eg, section)`: 申请此凭据的部门或单位。
* `Common Name (e.g. server FQDN or YOUR name)`: 服务器域名或申请人名字。
* `Email Address []`: 申请人邮箱地址。
* `A challenge password []`: 为该 SSL 凭据设置一个密码。
* `A challenge password []`: 为该 SSL 证书设置一个密码。
* `An optional company name []`: 一个可选的备用公司名。
注意:在网页服务器上,某些凭据在认证有效期内只能指定使用 `Common Name` 列明的项目。例如,为 `domain.com` 申请凭据后,用户访问 `www.domain.com` 或者 `secure.domain.com` 域名,依然会收到警告,因为 `www.domain.com``secure.domain.com` 不同于 `domain.com`
至此,你有了两个文件: `server.key``server.csr` 。前往选定的 SSL 凭据服务提供商处,上传 `server.csr` 文件以获取凭据授权。
__注意__有一些 web 服务器只能识别 `Common Name` 里指定的服务器地址。例如,使用为
`domain.com` 申请的证书,用户在访问 `www.domain.com` 或者 `secure.domain.com`
的网页时,会被警告当前网站使用的证书不可信,因为 `www.domain.com`
`secure.domain.com` 与证书的域名 `domain.com` 是不同的。
现在有了 `server.key``server.csr` 两个文件,前往选定的 SSL 证书供应商
的网站购买证书,它会要求你上传 `server.csr` 文件或输入该文件的内容,然后就可以
获得签发的 SSL 证书了。
通常情况下, SSL 服务提供商将会给你两个文件:
* server.crt
* server.ca-bundle
将上述两个文件和 `server.key` 文件上传到服务器的任意目录即可,以下是建议存放这些文件的路径:
我们需要着两个文件,以前之前生成的 `server.key`。将它们上传到服务器,以下是
推荐的存放路径:
* 在 RHEL/CentOS 系统上: `server.crt``server.ca-bundle` 上传至 `/etc/pki/tls/certs/` `server.key` 上传至 `/etc/pki/tls/private/`
* 在 Debian/Ubuntu FreeBSD 系统上: `server.crt``server.ca-bundle` 上传至 `/etc/ssl/certs/` `server.key` 上传至 `/etc/ssl/private/`
* 在 OpenBSD 系统上:上传至 `/etc/ssl/`
* 在 RHEL/CentOS 系统上:`server.crt` 和 `server.ca-bundle` 上传至
`/etc/pki/tls/certs/` `server.key` 上传至 `/etc/pki/tls/private/`
* 在 Debian/Ubuntu FreeBSD 系统上: `server.crt``server.ca-bundle` 上传至
`/etc/ssl/certs/` `server.key` 上传至`/etc/ssl/private/`。
* 在 OpenBSD 系统上:上传至 `/etc/ssl/`
## 配置 Postfix/Dovecot/Apache/Nginx 使用购买的 SSL 凭据
## 配置 Postfix/Dovecot/Apache/Nginx 使用购买的 SSL 证书
列教程中我们使用 CentOS 系统为例,请按照你的实际情况更改相关文件路径
面示例中我们以 CentOS 系统为例,请根据你的发行版调整相关文件路径(已在上面注明)
### Postfix (SMTP 服务器)
直接使用 `postconf` 命令来更新 SSL 凭据相关的设置:
直接使用 `postconf` 命令来更新 SSL 证书相关的设置:
```
postconf -e smtpd_use_tls='yes'
@ -64,7 +78,8 @@ postconf -e smtpd_tls_CAfile='/etc/pki/tls/certs/server.ca-bundle'
### Dovecot (POP3/IMAP 服务器)
Dovecot 的 SSL 凭据设置保存在主配置文件 `/etc/dovecot/dovecot.conf` (Linux/OpenBSD) 或者 `/usr/local/etc/dovecot/dovecot.conf` (FreeBSD) 之中:
Dovecot 的 SSL 证书设置定义在主配置文件 `/etc/dovecot/dovecot.conf`
(Linux/OpenBSD) 或 `/usr/local/etc/dovecot/dovecot.conf` (FreeBSD) 里:
```
ssl = required
@ -75,7 +90,7 @@ ssl_ca = </etc/pki/tls/certs/server.ca-bundle
修改后需重启 Dovecot 服务。
### Apache (网页服务器)
### Apache 网页服务器
* 在 RHEL/CentOS 系统上,配置文件为 `/etc/httpd/conf.d/ssl.conf`
* 在 Debian/Ubuntu 系统上,配置文件为 `/etc/apache2/sites-available/default-ssl`
@ -109,24 +124,23 @@ server {
}
```
即便在大部分浏览器能正常进行 SSL 凭据认证的情况下,依然会有某些浏览器只认可知名度高的 SSL 授权机构颁发的证书。This occurs because the issuing authority has signed the server certificate using an intermediate certificate that is not present in the certificate base of well-known trusted certificate authorities which is distributed with a particular browser.
In this case the authority provides a
bundle of chained certificates which should be concatenated to the signed
server certificate. The server certificate must appear before the chained
certificates in the combined file:
大部分浏览器能识别 SSL 证书,但可能有小部分浏览器无法正确识别。这种情况可以
`server.crt``server.ca-bundle` 的内容追加到一个新文件里,然后以这个
新文件作为 SSL 证书。注意:`server.crt` 的内容要在前面。
```
# cd /etc/pki/tls/certs/
# cat server.crt server.ca-bundle > server.chained.crt
```
然后更新 `/etc/nginx/conf.d/default.conf` 文件中的 `ssl_certificate` 参数:
更新 `/etc/nginx/conf.d/default.conf` 文件中的 `ssl_certificate` 参数:
```
ssl_certificate /etc/pki/tls/certs/server.chained.crt;
```
修改后需重启 Nginx 服务。
## 参资料
## 参资料
* [HTTPS 服务器配置](http://nginx.org/en/docs/http/configuring_https_servers.html)