New: backupmx.md. How to mark a mail domain as backup MX.

This commit is contained in:
Zhang Huangbin 2017-07-31 23:19:16 +08:00
parent 3466ca2d51
commit 6f41b31401
3 changed files with 163 additions and 0 deletions

71
en_US/howto/backupmx.md Normal file
View File

@ -0,0 +1,71 @@
# How to mark a mail domain as backup MX
[TOC]
This tutorial describes how to mark a mail domain as a backup MX.
## How backup MX works in brief
When smtp service on primary MX server is down, emails will be delivered to
backup MX server. When backup MX server detects smtp service on primary MX is
back online, it will relay received emails to primary MX.
## Make sure you have correct DNS records for the mail domain
To let other mail servers know your server is the backup MX server of this
mail domain, you must add your mail server info in its MX type DNS record.
For example, main mail server of your mail domain `example.com` is
`mx01.example.com`, to set your iRedMail server `mx02.example.com` as backup
MX of `example.com`, you need to add `mx02.example.com` as your lower priority
mail server in MX type DNS record.
```
example.com. 3600 IN MX 5 mx01.example.com
example.com. 3600 IN MX 10 mx02.example.com
```
Server `mx01.example.com` has priority number `5`, and `mx02.example.com` has
priority number `10`. For mail service, the lowest number has highest priority.
so with above example, server `mx01.example.com` is the primary MX, and
`mx02.example.com` is a backup MX.
When mail service on `mx01.example.com` is down, other mail services will
connect to `mx02.example.com`.
## Mark domain as backup MX with iRedAdmin-Pro
It's easy to manage domain profile With iRedAdmin-Pro, including backup MX setting.
Go to domain profile page, click tab `Backup MX`:
![](http://www.iredmail.org/images/iredadmin/domain_profile_backupmx.png){: width=1000px }
## Mark domain as backup MX with command line tools
### For SQL backends
!!! note "Primary server address"
You should set the IP address of primary MX as relay server to avoid mail
loop.
SQL commands (we use MySQL for example):
```
USE vmail;
UPDATE domain SET transport='relay:[45.56.127.226]:25',backupmx=1 WHERE domain='example.com';
```
In above example, we mark domain `example.com` as a backup MX, and use IP
address `45.56.127.226` as primary MX server, you should replace it by the real
IP address.
### For LDAP backends
In domain object, please add LDAP attribute/value pair like below:
```
domainBackupMX: yes
mtaTransport: relay:[45.56.127.226]:25
```

91
html/backupmx.html Normal file
View File

@ -0,0 +1,91 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>How to mark a mail domain as backup MX</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="how-to-mark-a-mail-domain-as-backup-mx">How to mark a mail domain as backup MX</h1>
<div class="toc">
<ul>
<li><a href="#how-to-mark-a-mail-domain-as-backup-mx">How to mark a mail domain as backup MX</a><ul>
<li><a href="#how-backup-mx-works-in-brief">How backup MX works in brief</a></li>
<li><a href="#make-sure-you-have-correct-dns-records-for-the-mail-domain">Make sure you have correct DNS records for the mail domain</a></li>
<li><a href="#mark-domain-as-backup-mx-with-iredadmin-pro">Mark domain as backup MX with iRedAdmin-Pro</a></li>
<li><a href="#mark-domain-as-backup-mx-with-command-line-tools">Mark domain as backup MX with command line tools</a><ul>
<li><a href="#for-sql-backends">For SQL backends</a></li>
<li><a href="#for-ldap-backends">For LDAP backends</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<p>This tutorial describes how to mark a mail domain as a backup MX.</p>
<h2 id="how-backup-mx-works-in-brief">How backup MX works in brief</h2>
<p>When smtp service on primary MX server is down, emails will be delivered to
backup MX server. When backup MX server detects smtp service on primary MX is
back online, it will relay received emails to primary MX.</p>
<h2 id="make-sure-you-have-correct-dns-records-for-the-mail-domain">Make sure you have correct DNS records for the mail domain</h2>
<p>To let other mail servers know your server is the backup MX server of this
mail domain, you must add your mail server info in its MX type DNS record.</p>
<p>For example, main mail server of your mail domain <code>example.com</code> is
<code>mx01.example.com</code>, to set your iRedMail server <code>mx02.example.com</code> as backup
MX of <code>example.com</code>, you need to add <code>mx02.example.com</code> as your lower priority
mail server in MX type DNS record. </p>
<pre><code>example.com. 3600 IN MX 5 mx01.example.com
example.com. 3600 IN MX 10 mx02.example.com
</code></pre>
<p>Server <code>mx01.example.com</code> has priority number <code>5</code>, and <code>mx02.example.com</code> has
priority number <code>10</code>. For mail service, the lowest number has highest priority.
so with above example, server <code>mx01.example.com</code> is the primary MX, and
<code>mx02.example.com</code> is a backup MX.</p>
<p>When mail service on <code>mx01.example.com</code> is down, other mail services will
connect to <code>mx02.example.com</code>.</p>
<h2 id="mark-domain-as-backup-mx-with-iredadmin-pro">Mark domain as backup MX with iRedAdmin-Pro</h2>
<p>It's easy to manage domain profile With iRedAdmin-Pro, including backup MX setting.
Go to domain profile page, click tab <code>Backup MX</code>:</p>
<p><img alt="" src="http://www.iredmail.org/images/iredadmin/domain_profile_backupmx.png" width="1000px" /></p>
<h2 id="mark-domain-as-backup-mx-with-command-line-tools">Mark domain as backup MX with command line tools</h2>
<h3 id="for-sql-backends">For SQL backends</h3>
<div class="admonition note">
<p class="admonition-title">Primary server address</p>
<p>You should set the IP address of primary MX as relay server to avoid mail
loop.</p>
</div>
<p>SQL commands (we use MySQL for example):</p>
<pre><code>USE vmail;
UPDATE domain SET transport='relay:[45.56.127.226]:25',backupmx=1 WHERE domain='example.com';
</code></pre>
<p>In above example, we mark domain <code>example.com</code> as a backup MX, and use IP
address <code>45.56.127.226</code> as primary MX server, you should replace it by the real
IP address.</p>
<h3 id="for-ldap-backends">For LDAP backends</h3>
<p>In domain object, please add LDAP attribute/value pair like below:</p>
<pre><code>domainBackupMX: yes
mtaTransport: relay:[45.56.127.226]:25
</code></pre><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

@ -104,6 +104,7 @@
<li><a href="amavisd.per-recipient.policy.lookup.html">Amavisd: Enable per-recipient policy lookup</a></li>
<li><a href="amavisd.wblist.html">Whitelists and Blacklists</a></li>
<li><a href="authenticate.without.domain.name.html">Authenticate without domain part in email address</a></li>
<li><a href="backupmx.html">How to mark a mail domain as backup MX</a></li>
<li><a href="change.server.hostname.html">Change server hostname</a></li>
<li><a href="concurrent.processing.html">Process more emails concurrently</a></li>
<li><a href="dovecot.master.user.html">Dovecot Master User: Access user's mailbox without owner's password.</a></li>