This commit is contained in:
github-actions[bot] 2021-09-22 23:30:04 +00:00
parent 07afd2c901
commit 4d20a99272
46 changed files with 847 additions and 862 deletions

View file

@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" content="A fullstack but simple mail server (SMTP, IMAP, LDAP, Antispam, Antivirus, etc.) using Docker.">
<meta name="description" content="A fullstack but simple mail-server (SMTP, IMAP, LDAP, Antispam, Antivirus, etc.) using Docker.">
@ -16,7 +16,7 @@
<link rel="canonical" href="https://docker-mailserver.github.io/docker-mailserver/edge/examples/tutorials/basic-installation/">
<link rel="icon" href="../../../assets/logo/favicon-32x32.png">
<meta name="generator" content="mkdocs-1.2.2, mkdocs-material-7.2.6">
<meta name="generator" content="mkdocs-1.2.2, mkdocs-material-7.2.8">
@ -24,7 +24,7 @@
<link rel="stylesheet" href="../../../assets/stylesheets/main.802231af.min.css">
<link rel="stylesheet" href="../../../assets/stylesheets/main.92558b1b.min.css">
<link rel="stylesheet" href="../../../assets/stylesheets/palette.3f5d1f46.min.css">
@ -73,7 +73,7 @@
<div data-md-component="skip">
<a href="#building-a-simple-mailserver" class="md-skip">
<a href="#building-a-simple-mail-server" class="md-skip">
Skip to content
</a>
@ -1048,8 +1048,8 @@
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#building-a-simple-mailserver" class="md-nav__link">
Building a Simple Mailserver
<a href="#building-a-simple-mail-server" class="md-nav__link">
Building a Simple Mail-Server
</a>
</li>
@ -1068,7 +1068,7 @@
<li class="md-nav__item">
<a href="../mailserver-behind-proxy/" class="md-nav__link">
Mailserver behind Proxy
Mail-Server behind a Proxy
</a>
</li>
@ -1119,7 +1119,7 @@
<li class="md-nav__item">
<a href="../../uses-cases/forward-only-mailserver-with-ldap-authentication/" class="md-nav__link">
Forward-Only Mailserver with LDAP
Forward-Only Mail-Server with LDAP
</a>
</li>
@ -1296,8 +1296,8 @@
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#building-a-simple-mailserver" class="md-nav__link">
Building a Simple Mailserver
<a href="#building-a-simple-mail-server" class="md-nav__link">
Building a Simple Mail-Server
</a>
</li>
@ -1321,7 +1321,7 @@
<h1>Basic Installation</h1>
<h2 id="building-a-simple-mailserver"><a class="toclink" href="#building-a-simple-mailserver">Building a Simple Mailserver</a></h2>
<h2 id="building-a-simple-mail-server"><a class="toclink" href="#building-a-simple-mail-server">Building a Simple Mail-Server</a></h2>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>Adding the docker network's gateway to the list of trusted hosts, e.g. using the <code>network</code> or <code>connected-networks</code> option, can create an <a href="https://en.wikipedia.org/wiki/Open_mail_relay"><strong>open relay</strong></a>, for instance <a href="https://github.com/docker-mailserver/docker-mailserver/issues/1405#issuecomment-590106498">if IPv6 is enabled on the host machine but not in Docker</a>.</p>
@ -1329,9 +1329,9 @@
<p>We are going to use this docker based mailserver:</p>
<ul>
<li>
<p>First create a directory for the mailserver and get the setup script:</p>
<div class="highlight"><pre><span></span><code>mkdir -p /var/ds/mail.example.org
<span class="nb">cd</span> /var/ds/mail.example.org/
<p>First create a directory for <code>docker-mailserver</code> to store data in, and get the <code>setup.sh</code> script:</p>
<div class="highlight"><pre><span></span><code>mkdir -p /var/ds/mail.example.com
<span class="nb">cd</span> /var/ds/mail.example.com/
curl -o setup.sh <span class="se">\</span>
https://raw.githubusercontent.com/docker-mailserver/docker-mailserver/master/setup.sh
@ -1347,19 +1347,19 @@ chmod a+x ./setup.sh
<span class="nt">services</span><span class="p">:</span>
<span class="nt">mailserver</span><span class="p">:</span>
<span class="nt">image</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">docker.io/mailserver/docker-mailserver:latest</span>
<span class="nt">container_name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">mailserver</span>
<span class="nt">hostname</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">mail</span>
<span class="nt">domainname</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">example.com</span>
<span class="nt">container_name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">mailserver</span>
<span class="nt">ports</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="s">&quot;25:25&quot;</span>
<span class="p p-Indicator">-</span> <span class="s">&quot;587:587&quot;</span>
<span class="p p-Indicator">-</span> <span class="s">&quot;465:465&quot;</span>
<span class="nt">volumes</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">./data/maildata:/var/mail</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">./data/mailstate:/var/mail-state</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">./data/maillogs:/var/log/mail</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">./docker-data/dms/mail-data/:/var/mail/</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">./docker-data/dms/mail-state/:/var/mail-state/</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">./docker-data/dms/mail-logs/:/var/log/mail/</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">./docker-data/dms/config/:/tmp/docker-mailserver/</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">/etc/localtime:/etc/localtime:ro</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">./config/:/tmp/docker-mailserver/</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">/var/ds/wsproxy/letsencrypt/:/etc/letsencrypt/</span>
<span class="nt">environment</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">PERMIT_DOCKER=network</span>
@ -1382,7 +1382,7 @@ chmod a+x ./setup.sh
<li><a href="../../../config/environment/">Environment Variables</a></li>
<li><a href="https://github.com/docker-mailserver/docker-mailserver/blob/master/mailserver.env"><code>mailserver.env</code> file</a></li>
</ul>
<p>Make sure to set the proper <code>domainname</code> that you will use for the emails. We forward only SMTP ports (not POP3 and IMAP) because we are not interested in accessing the mailserver directly (from a client). We also use these settings:</p>
<p>Make sure to set the proper <code>domainname</code> that you will use for the emails. We forward only SMTP ports (not POP3 and IMAP) because we are not interested in accessing the mail-server directly (from a client). We also use these settings:</p>
<ul>
<li><code>PERMIT_DOCKER=network</code> because we want to send emails from other docker containers.</li>
<li><code>SSL_TYPE=letsencrypt</code> because we will manage SSL certificates with letsencrypt.</li>
@ -1400,18 +1400,18 @@ ufw allow <span class="m">465</span>
<p>Pull the docker image: <code>docker pull mailserver/docker-mailserver:latest</code></p>
</li>
<li>
<p>Now generate the DKIM keys with <code>./setup.sh config dkim</code> and copy the content of the file <code>config/opendkim/keys/domain.tld/mail.txt</code> on the domain zone configuration at the DNS server. I use <a href="https://github.com/docker-scripts/bind9">bind9</a> for managing my domains, so I just paste it on <code>example.org.db</code>:</p>
<p>Now generate the DKIM keys with <code>./setup.sh config dkim</code> and copy the content of the file <code>docker-data/dms/config/opendkim/keys/example.com/mail.txt</code> on the domain zone configuration at the DNS server. I use <a href="https://github.com/docker-scripts/bind9">bind9</a> for managing my domains, so I just paste it on <code>example.com.db</code>:</p>
<div class="highlight"><pre><span></span><code>mail._domainkey IN TXT ( &quot;v=DKIM1; h=sha256; k=rsa; &quot;
&quot;p=MIIBIjANBgkqhkiG9w0BAQEFACAQ8AMIIBCgKCAQEAaH5KuPYPSF3Ppkt466BDMAFGOA4mgqn4oPjZ5BbFlYA9l5jU3bgzRj3l6/Q1n5a9lQs5fNZ7A/HtY0aMvs3nGE4oi+LTejt1jblMhV/OfJyRCunQBIGp0s8G9kIUBzyKJpDayk2+KJSJt/lxL9Iiy0DE5hIv62ZPP6AaTdHBAsJosLFeAzuLFHQ6USyQRojefqFQtgYqWQ2JiZQ3&quot;
&quot;iqq3bD/BVlwKRp5gH6TEYEmx8EBJUuDxrJhkWRUk2VDl1fqhVBy8A9O7Ah+85nMrlOHIFsTaYo9o6+cDJ6t1i6G1gu+bZD0d3/3bqGLPBQV9LyEL1Rona5V7TJBGg099NQkTz1IwIDAQAB&quot; ) ; ----- DKIM key mail for example.org
&quot;iqq3bD/BVlwKRp5gH6TEYEmx8EBJUuDxrJhkWRUk2VDl1fqhVBy8A9O7Ah+85nMrlOHIFsTaYo9o6+cDJ6t1i6G1gu+bZD0d3/3bqGLPBQV9LyEL1Rona5V7TJBGg099NQkTz1IwIDAQAB&quot; ) ; ----- DKIM key mail for example.com
</code></pre></div>
</li>
<li>
<p>Add these configurations as well on the same file on the DNS server:</p>
<div class="highlight"><pre><span></span><code>mail IN A 10.11.12.13
; mailservers for example.org
3600 IN MX 1 mail.example.org.
; mail-server for example.com
3600 IN MX 1 mail.example.com.
; Add SPF record
IN TXT &quot;v=spf1 mx ~all&quot;
@ -1421,51 +1421,51 @@ ufw allow <span class="m">465</span>
<li>
<p>Get an SSL certificate from letsencrypt. I use <a href="https://gitlab.com/docker-scripts/wsproxy">wsproxy</a> for managing SSL letsencrypt certificates of my domains:</p>
<div class="highlight"><pre><span></span><code><span class="nb">cd</span> /var/ds/wsproxy
ds domains-add mail mail.example.org
ds get-ssl-cert myemail@gmail.com mail.example.org --test
ds get-ssl-cert myemail@gmail.com mail.example.org
ds domains-add mail mail.example.com
ds get-ssl-cert external-account@gmail.com mail.example.com --test
ds get-ssl-cert external-account@gmail.com mail.example.com
</code></pre></div>
<p>Now the certificates will be available on <code>/var/ds/wsproxy/letsencrypt/live/mail.example.org</code>.</p>
<p>Now the certificates will be available on <code>/var/ds/wsproxy/letsencrypt/live/mail.example.com</code>.</p>
</li>
<li>
<p>Start the mailserver and check for any errors:</p>
<p>Start <code>docker-mailserver</code> and check for any errors:</p>
<div class="highlight"><pre><span></span><code>apt install docker-compose
docker-compose up mail
docker-compose up mailserver
</code></pre></div>
</li>
<li>
<p>Create email accounts and aliases with <code>SPOOF_PROTECTION=0</code>:</p>
<div class="highlight"><pre><span></span><code>./setup.sh email add admin@example.org passwd123
./setup.sh email add info@example.org passwd123
./setup.sh <span class="nb">alias</span> add admin@example.org myemail@gmail.com
./setup.sh <span class="nb">alias</span> add info@example.org myemail@gmail.com
<div class="highlight"><pre><span></span><code>./setup.sh email add admin@example.com passwd123
./setup.sh email add info@example.com passwd123
./setup.sh <span class="nb">alias</span> add admin@example.com external-account@gmail.com
./setup.sh <span class="nb">alias</span> add info@example.com external-account@gmail.com
./setup.sh email list
./setup.sh <span class="nb">alias</span> list
</code></pre></div>
<p>Aliases make sure that any email that comes to these accounts is forwarded to my real email address, so that I don't need to use POP3/IMAP in order to get these messages. Also no anti-spam and anti-virus software is needed, making the mailserver lighter.</p>
<p>Aliases make sure that any email that comes to these accounts is forwarded to my real email address, so that I don't need to use POP3/IMAP in order to get these messages. Also no anti-spam and anti-virus software is needed, making the mail-server lighter.</p>
</li>
<li>
<p>Or create email accounts and aliases with <code>SPOOF_PROTECTION=1</code>:</p>
<div class="highlight"><pre><span></span><code>./setup.sh email add admin.gmail@example.org passwd123
./setup.sh email add info.gmail@example.org passwd123
./setup.sh <span class="nb">alias</span> add admin@example.org admin.gmail@example.org
./setup.sh <span class="nb">alias</span> add info@example.org info.gmail@example.org
./setup.sh <span class="nb">alias</span> add admin.gmail@example.org myemail@gmail.com
./setup.sh <span class="nb">alias</span> add info.gmail@example.org myemail@gmail.com
<div class="highlight"><pre><span></span><code>./setup.sh email add admin.gmail@example.com passwd123
./setup.sh email add info.gmail@example.com passwd123
./setup.sh <span class="nb">alias</span> add admin@example.com admin.gmail@example.com
./setup.sh <span class="nb">alias</span> add info@example.com info.gmail@example.com
./setup.sh <span class="nb">alias</span> add admin.gmail@example.com external-account@gmail.com
./setup.sh <span class="nb">alias</span> add info.gmail@example.com external-account@gmail.com
./setup.sh email list
./setup.sh <span class="nb">alias</span> list
</code></pre></div>
<p>This extra step is required to avoid the <code>553 5.7.1 Sender address rejected: not owned by user</code> error (the account used for setting up Gmail is <code>admin.gmail@example.org</code> and <code>info.gmail@example.org</code> )</p>
<p>This extra step is required to avoid the <code>553 5.7.1 Sender address rejected: not owned by user</code> error (the account used for setting up Gmail is <code>admin.gmail@example.com</code> and <code>info.gmail@example.com</code> )</p>
</li>
<li>
<p>Send some test emails to these addresses and make other tests. Then stop the container with <code>ctrl+c</code> and start it again as a daemon: <code>docker-compose up -d mail</code>.</p>
<p>Send some test emails to these addresses and make other tests. Then stop the container with <code>ctrl+c</code> and start it again as a daemon: <code>docker-compose up -d mailserver</code>.</p>
</li>
<li>
<p>Now save on Moodle configuration the SMTP settings and test by trying to send some messages to other users:</p>
<ul>
<li><strong>SMTP hosts</strong>: <code>mail.example.org:465</code></li>
<li><strong>SMTP hosts</strong>: <code>mail.example.com:465</code></li>
<li><strong>SMTP security</strong>: <code>SSL</code></li>
<li><strong>SMTP username</strong>: <code>info@example.org</code></li>
<li><strong>SMTP username</strong>: <code>info@example.com</code></li>
<li><strong>SMTP password</strong>: <code>passwd123</code></li>
</ul>
</li>
@ -1512,13 +1512,13 @@ docker-compose up mail
<a href="../mailserver-behind-proxy/" class="md-footer__link md-footer__link--next" aria-label="Next: Mailserver behind Proxy" rel="next">
<a href="../mailserver-behind-proxy/" class="md-footer__link md-footer__link--next" aria-label="Next: Mail-Server behind a Proxy" rel="next">
<div class="md-footer__title">
<div class="md-ellipsis">
<span class="md-footer__direction">
Next
</span>
Mailserver behind Proxy
Mail-Server behind a Proxy
</div>
</div>
<div class="md-footer__button md-icon">
@ -1551,10 +1551,10 @@ docker-compose up mail
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "../../..", "features": ["navigation.tabs", "navigation.top", "navigation.expand", "navigation.instant"], "translations": {"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing", "select.version.title": "Select version"}, "search": "../../../assets/javascripts/workers/search.409db549.min.js", "version": {"provider": "mike"}}</script>
<script id="__config" type="application/json">{"base": "../../..", "features": ["navigation.tabs", "navigation.top", "navigation.expand", "navigation.instant"], "translations": {"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing", "select.version.title": "Select version"}, "search": "../../../assets/javascripts/workers/search.94ec81fe.min.js", "version": {"provider": "mike"}}</script>
<script src="../../../assets/javascripts/bundle.756773cc.min.js"></script>
<script src="../../../assets/javascripts/bundle.48dfec6c.min.js"></script>
</body>

View file

@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" content="A fullstack but simple mail server (SMTP, IMAP, LDAP, Antispam, Antivirus, etc.) using Docker.">
<meta name="description" content="A fullstack but simple mail-server (SMTP, IMAP, LDAP, Antispam, Antivirus, etc.) using Docker.">
@ -16,7 +16,7 @@
<link rel="canonical" href="https://docker-mailserver.github.io/docker-mailserver/edge/examples/tutorials/blog-posts/">
<link rel="icon" href="../../../assets/logo/favicon-32x32.png">
<meta name="generator" content="mkdocs-1.2.2, mkdocs-material-7.2.6">
<meta name="generator" content="mkdocs-1.2.2, mkdocs-material-7.2.8">
@ -24,7 +24,7 @@
<link rel="stylesheet" href="../../../assets/stylesheets/main.802231af.min.css">
<link rel="stylesheet" href="../../../assets/stylesheets/main.92558b1b.min.css">
<link rel="stylesheet" href="../../../assets/stylesheets/palette.3f5d1f46.min.css">
@ -1027,7 +1027,7 @@
<li class="md-nav__item">
<a href="../mailserver-behind-proxy/" class="md-nav__link">
Mailserver behind Proxy
Mail-Server behind a Proxy
</a>
</li>
@ -1086,7 +1086,7 @@
<li class="md-nav__item">
<a href="../../uses-cases/forward-only-mailserver-with-ldap-authentication/" class="md-nav__link">
Forward-Only Mailserver with LDAP
Forward-Only Mail-Server with LDAP
</a>
</li>
@ -1258,11 +1258,11 @@
<h1>Blog Posts</h1>
<p>This site lists blog entries that write about the project. If you blogged about <code>docker-mailserver</code> as well feel free to add your site!</p>
<p>This site lists blog entries that write about the project. If you blogged about <code>docker-mailserver</code> let us know so we can add it here!</p>
<ul>
<li><a href="https://lowtek.ca/roo/2021/installing-docker-mailserver/">Installing docker-mailserver</a> by <a href="https://github.com/andrewlow">@andrewlow</a> </li>
<li><a href="https://tvi.al/simple-mail-server-with-docker/">Simple Mailserver with docker</a> by <a href="https://github.com/tomav">@tomav</a></li>
<li><a href="https://www.ifthenel.se/self-hosted-mail-server/">Self hosted mail server</a> by <a href="https://github.com/matrixes">@matrixes</a></li>
<li><a href="https://lowtek.ca/roo/2021/installing-docker-mailserver/">Installing docker-mailserver</a> by <a href="https://github.com/andrewlow">@andrewlow</a></li>
<li><a href="https://tvi.al/simple-mail-server-with-docker/">Simple mail-server with docker</a> by <a href="https://github.com/tomav">@tomav</a></li>
<li><a href="https://www.ifthenel.se/self-hosted-mail-server/">Self hosted mail-server</a> by <a href="https://github.com/matrixes">@matrixes</a></li>
</ul>
@ -1290,7 +1290,7 @@
<nav class="md-footer__inner md-grid" aria-label="Footer">
<a href="../mailserver-behind-proxy/" class="md-footer__link md-footer__link--prev" aria-label="Previous: Mailserver behind Proxy" rel="prev">
<a href="../mailserver-behind-proxy/" class="md-footer__link md-footer__link--prev" aria-label="Previous: Mail-Server behind a Proxy" rel="prev">
<div class="md-footer__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
</div>
@ -1299,20 +1299,20 @@
<span class="md-footer__direction">
Previous
</span>
Mailserver behind Proxy
Mail-Server behind a Proxy
</div>
</div>
</a>
<a href="../../uses-cases/forward-only-mailserver-with-ldap-authentication/" class="md-footer__link md-footer__link--next" aria-label="Next: Forward-Only Mailserver with LDAP" rel="next">
<a href="../../uses-cases/forward-only-mailserver-with-ldap-authentication/" class="md-footer__link md-footer__link--next" aria-label="Next: Forward-Only Mail-Server with LDAP" rel="next">
<div class="md-footer__title">
<div class="md-ellipsis">
<span class="md-footer__direction">
Next
</span>
Forward-Only Mailserver with LDAP
Forward-Only Mail-Server with LDAP
</div>
</div>
<div class="md-footer__button md-icon">
@ -1345,10 +1345,10 @@
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "../../..", "features": ["navigation.tabs", "navigation.top", "navigation.expand", "navigation.instant"], "translations": {"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing", "select.version.title": "Select version"}, "search": "../../../assets/javascripts/workers/search.409db549.min.js", "version": {"provider": "mike"}}</script>
<script id="__config" type="application/json">{"base": "../../..", "features": ["navigation.tabs", "navigation.top", "navigation.expand", "navigation.instant"], "translations": {"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing", "select.version.title": "Select version"}, "search": "../../../assets/javascripts/workers/search.94ec81fe.min.js", "version": {"provider": "mike"}}</script>
<script src="../../../assets/javascripts/bundle.756773cc.min.js"></script>
<script src="../../../assets/javascripts/bundle.48dfec6c.min.js"></script>
</body>

View file

@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" content="A fullstack but simple mail server (SMTP, IMAP, LDAP, Antispam, Antivirus, etc.) using Docker.">
<meta name="description" content="A fullstack but simple mail-server (SMTP, IMAP, LDAP, Antispam, Antivirus, etc.) using Docker.">
@ -16,15 +16,15 @@
<link rel="canonical" href="https://docker-mailserver.github.io/docker-mailserver/edge/examples/tutorials/mailserver-behind-proxy/">
<link rel="icon" href="../../../assets/logo/favicon-32x32.png">
<meta name="generator" content="mkdocs-1.2.2, mkdocs-material-7.2.6">
<meta name="generator" content="mkdocs-1.2.2, mkdocs-material-7.2.8">
<title>Tutorials | Mailserver behind Proxy - Docker Mailserver</title>
<title>Tutorials | Mail-Server behind a Proxy - Docker Mailserver</title>
<link rel="stylesheet" href="../../../assets/stylesheets/main.802231af.min.css">
<link rel="stylesheet" href="../../../assets/stylesheets/main.92558b1b.min.css">
<link rel="stylesheet" href="../../../assets/stylesheets/palette.3f5d1f46.min.css">
@ -102,7 +102,7 @@
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
Tutorials | Mailserver behind Proxy
Tutorials | Mail-Server behind a Proxy
</span>
</div>
@ -1039,12 +1039,12 @@
<label class="md-nav__link md-nav__link--active" for="__toc">
Mailserver behind Proxy
Mail-Server behind a Proxy
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" class="md-nav__link md-nav__link--active">
Mailserver behind Proxy
Mail-Server behind a Proxy
</a>
@ -1146,7 +1146,7 @@
<li class="md-nav__item">
<a href="../../uses-cases/forward-only-mailserver-with-ldap-authentication/" class="md-nav__link">
Forward-Only Mailserver with LDAP
Forward-Only Mail-Server with LDAP
</a>
</li>
@ -1373,7 +1373,7 @@
</a>
<h1>Mailserver behind Proxy</h1>
<h1>Mail-Server behind a Proxy</h1>
<h2 id="using-docker-mailserver-behind-a-proxy"><a class="toclink" href="#using-docker-mailserver-behind-a-proxy">Using <code>docker-mailserver</code> behind a Proxy</a></h2>
<h3 id="information"><a class="toclink" href="#information">Information</a></h3>
@ -1389,12 +1389,12 @@
<p>Luckily <code>dovecot</code> and <code>postfix</code> are both Proxy-Protocol ready softwares so it depends only on your used reverse-proxy / loadbalancer.</p>
<h3 id="configuration-of-the-used-proxy-software"><a class="toclink" href="#configuration-of-the-used-proxy-software">Configuration of the used Proxy Software</a></h3>
<p>The configuration depends on the used proxy system. I will provide the configuration examples of <a href="https://traefik.io/">traefik v2</a> using IMAP and SMTP with implicit TLS.</p>
<p>Feel free to add your configuration if you archived the same goal using different proxy software below:</p>
<p>Feel free to add your configuration if you achieved the same goal using different proxy software below:</p>
<details><summary>Traefik v2</summary><p>Truncated configuration of traefik itself:</p>
<div class="highlight"><pre><span></span><code><span class="nt">version</span><span class="p">:</span> <span class="s">&#39;3.7&#39;</span>
<div class="highlight"><pre><span></span><code><span class="nt">version</span><span class="p">:</span> <span class="s">&#39;3.8&#39;</span>
<span class="nt">services</span><span class="p">:</span>
<span class="nt">reverse-proxy</span><span class="p">:</span>
<span class="nt">image</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">traefik:latest</span>
<span class="nt">image</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">docker.io/traefik:latest</span> <span class="c1"># v2.5</span>
<span class="nt">container_name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">docker-traefik</span>
<span class="nt">restart</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">always</span>
<span class="nt">command</span><span class="p">:</span>
@ -1414,14 +1414,14 @@
<span class="p p-Indicator">-</span> <span class="s">&quot;4190:4190&quot;</span>
<span class="p p-Indicator">[</span><span class="nv">...</span><span class="p p-Indicator">]</span>
</code></pre></div>
<p>Truncated list of necessary labels on the mailserver container:</p>
<p>Truncated list of necessary labels on the <code>docker-mailserver</code> container:</p>
<div class="highlight"><pre><span></span><code><span class="nt">version</span><span class="p">:</span> <span class="s">&#39;3.8&#39;</span>
<span class="nt">services</span><span class="p">:</span>
<span class="nt">mailserver</span><span class="p">:</span>
<span class="nt">image</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">docker.io/mailserver/docker-mailserver:latest</span>
<span class="nt">container_name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">mailserver</span>
<span class="nt">hostname</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">mail</span>
<span class="nt">domainname</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">example.com</span>
<span class="nt">container_name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">mailserver</span>
<span class="nt">restart</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">always</span>
<span class="nt">networks</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">proxy</span>
@ -1453,14 +1453,14 @@
</details>
<h3 id="configuration-of-the-backend-dovecot-and-postfix"><a class="toclink" href="#configuration-of-the-backend-dovecot-and-postfix">Configuration of the Backend (<code>dovecot</code> and <code>postfix</code>)</a></h3>
<p>The following changes can be achieved completely by adding the content to the appropriate files by using the projects <a href="../../../config/advanced/optional-config/">function to overwrite config files</a>.</p>
<p>Changes for <code>postfix</code> can be applied by adding the following content to <code>config/postfix-main.cf</code>:</p>
<p>Changes for <code>postfix</code> can be applied by adding the following content to <code>docker-data/dms/config/postfix-main.cf</code>:</p>
<div class="highlight"><pre><span></span><code><span class="na">postscreen_upstream_proxy_protocol</span> <span class="o">=</span> <span class="s">haproxy</span>
</code></pre></div>
<p>and to <code>config/postfix-master.cf</code>:</p>
<p>and to <code>docker-data/dms/config/postfix-master.cf</code>:</p>
<div class="highlight"><pre><span></span><code><span class="na">submission/inet/smtpd_upstream_proxy_protocol</span><span class="o">=</span><span class="s">haproxy</span>
<span class="na">smtps/inet/smtpd_upstream_proxy_protocol</span><span class="o">=</span><span class="s">haproxy</span>
</code></pre></div>
<p>Changes for <code>dovecot</code> can be applied by adding the following content to <code>config/dovecot.cf</code>:</p>
<p>Changes for <code>dovecot</code> can be applied by adding the following content to <code>docker-data/dms/config/dovecot.cf</code>:</p>
<div class="highlight"><pre><span></span><code><span class="na">haproxy_trusted_networks</span> <span class="o">=</span> <span class="s">&lt;your-proxy-ip&gt;, &lt;optional-cidr-notation&gt;</span>
<span class="na">haproxy_timeout</span> <span class="o">=</span> <span class="s">3 secs</span>
<span class="na">service imap-login {</span>
@ -1556,10 +1556,10 @@
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "../../..", "features": ["navigation.tabs", "navigation.top", "navigation.expand", "navigation.instant"], "translations": {"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing", "select.version.title": "Select version"}, "search": "../../../assets/javascripts/workers/search.409db549.min.js", "version": {"provider": "mike"}}</script>
<script id="__config" type="application/json">{"base": "../../..", "features": ["navigation.tabs", "navigation.top", "navigation.expand", "navigation.instant"], "translations": {"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing", "select.version.title": "Select version"}, "search": "../../../assets/javascripts/workers/search.94ec81fe.min.js", "version": {"provider": "mike"}}</script>
<script src="../../../assets/javascripts/bundle.756773cc.min.js"></script>
<script src="../../../assets/javascripts/bundle.48dfec6c.min.js"></script>
</body>