This commit is contained in:
github-actions[bot] 2022-08-02 11:38:53 +00:00
parent d1ab8bd3ad
commit 7206bbe86f
5 changed files with 80 additions and 51 deletions

View file

@ -1697,10 +1697,37 @@ docker-compose up -d
</li>
<li>
<p>Run the following command in a daily cron job:</p>
<div class="highlight"><pre><span></span><code>docker-compose exec mailserver doveadm fts optimize -A
<p><div class="highlight"><pre><span></span><code>docker-compose exec mailserver doveadm fts optimize -A
</code></pre></div>
Or like the <a href="../../../faq/#how-can-i-make-spamassassin-better-recognize-spam">Spamassassin example</a> shows, you can instead use <code>cron</code> from within <code>docker-mailserver</code> to avoid potential errors if the mail-server is not running:</p>
</li>
</ol>
<details class="example">
<summary>Example</summary>
<p>Create a <em>system</em> cron file:</p>
<div class="highlight"><pre><span></span><code><span class="c1"># in the docker-compose.yml root directory</span>
mkdir -p ./docker-data/dms/cron <span class="c1"># if you didn&#39;t have this folder before</span>
touch ./docker-data/dms/cron/fts_xapian
chown root:root ./docker-data/dms/cron/fts_xapian
chmod <span class="m">0644</span> ./docker-data/dms/cron/fts_xapian
</code></pre></div>
<p>Edit the system cron file <code>nano ./docker-data/dms/cron/fts_xapian</code>, and set an appropriate configuration:</p>
<div class="highlight"><pre><span></span><code><span class="c1"># Adding `MAILTO=&quot;&quot;` prevents cron emailing notifications of the task outcome each run</span><span class="w"></span>
<span class="na">MAILTO</span><span class="o">=</span><span class="s">&quot;&quot;</span><span class="w"></span>
<span class="c1">#</span><span class="w"></span>
<span class="c1"># m h dom mon dow user command</span><span class="w"></span>
<span class="c1">#</span><span class="w"></span>
<span class="c1"># Everyday 4:00AM, optimize index files</span><span class="w"></span>
<span class="na">0 4 * * * root doveadm fts optimize -A</span><span class="w"></span>
</code></pre></div>
<p>Then with <code>docker-compose.yml</code>:</p>
<div class="highlight"><pre><span></span><code><span class="nt">services</span><span class="p">:</span><span class="w"></span>
<span class="w"> </span><span class="nt">mailserver</span><span class="p">:</span><span class="w"></span>
<span class="w"> </span><span class="nt">image</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">docker.io/mailserver/docker-mailserver:latest</span><span class="w"></span>
<span class="w"> </span><span class="nt">volumes</span><span class="p">:</span><span class="w"></span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">./docker-data/dms/cron/fts_xapian:/etc/cron.d/fts_xapian</span><span class="w"></span>
</code></pre></div>
</details>
<h3 id="solr"><a class="toclink" href="#solr">Solr</a></h3>
<p>The <a href="https://wiki2.dovecot.org/Plugins/FTS/Solr">dovecot-solr Plugin</a> is used in conjunction with <a href="https://lucene.apache.org/solr/">Apache Solr</a> running in a separate container. This is quite straightforward to setup using the following instructions.</p>
<p>Solr is a mature and fast indexing backend that runs on the JVM. The indexes are relatively compact compared to the size of your total email. </p>

View file

@ -3344,7 +3344,7 @@
<h5 id="one_dir"><a class="toclink" href="#one_dir">ONE_DIR</a></h5>
<ul>
<li>0 =&gt; state in default directories.</li>
<li><strong>1</strong> =&gt; consolidate all states into a single directory (<code>/var/mail-state</code>) to allow persistence using docker volumes. See the <a href="../../faq/#what-is-the-mail-state-folder-for">related FAQ entry</a> for more information.</li>
<li><strong>1</strong> =&gt; consolidate all states into a single directory (<code>/var/mail-state</code>) to allow persistence using docker volumes. See the <a href="../../faq/#what-about-docker-datadmsmail-state-folder-varmail-state-internally">related FAQ entry</a> for more information.</li>
</ul>
<h5 id="permit_docker"><a class="toclink" href="#permit_docker">PERMIT_DOCKER</a></h5>
<p>Set different options for mynetworks option (can be overwrite in postfix-main.cf) <strong>WARNING</strong>: 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 if IPv6 is enabled on the host machine but not in Docker.</p>

View file

@ -2034,23 +2034,25 @@ chmod <span class="m">0644</span> ./docker-data/dms/cron/sa-learn
<div class="highlight"><pre><span></span><code><span class="c1"># This assumes you&#39;re having `environment: ONE_DIR=1` in the env-mailserver,</span><span class="w"></span>
<span class="c1"># with a consolidated config in `/var/mail-state`</span><span class="w"></span>
<span class="c1">#</span><span class="w"></span>
<span class="c1"># &#39;&gt; /dev/null&#39; to send error notifications from &#39;stderr&#39; to &#39;postmaster@example.com&#39;</span><span class="w"></span>
<span class="c1">#</span><span class="w"></span>
<span class="c1"># m h dom mon dow user command</span><span class="w"></span>
<span class="c1">#</span><span class="w"></span>
<span class="c1"># Everyday 2:00AM, learn spam from a specific user</span><span class="w"></span>
<span class="c1"># spam: junk directory</span><span class="w"></span>
<span class="na">0 2 * * * root sa-learn --spam /var/mail/example.com/username/.Junk --dbpath /var/mail-state/lib-amavis/.spamassassin</span><span class="w"></span>
<span class="na">0 2 * * * root sa-learn --spam /var/mail/example.com/username/.Junk --dbpath /var/mail-state/lib-amavis/.spamassassin &gt; /dev/null</span><span class="w"></span>
<span class="c1"># ham: archive directories</span><span class="w"></span>
<span class="na">15 2 * * * root sa-learn --ham /var/mail/example.com/username/.Archive* --dbpath /var/mail-state/lib-amavis/.spamassassin</span><span class="w"></span>
<span class="na">15 2 * * * root sa-learn --ham /var/mail/example.com/username/.Archive* --dbpath /var/mail-state/lib-amavis/.spamassassin &gt; /dev/null</span><span class="w"></span>
<span class="c1"># ham: inbox subdirectories</span><span class="w"></span>
<span class="na">30 2 * * * root sa-learn --ham /var/mail/example.com/username/cur* --dbpath /var/mail-state/lib-amavis/.spamassassin</span><span class="w"></span>
<span class="na">30 2 * * * root sa-learn --ham /var/mail/example.com/username/cur* --dbpath /var/mail-state/lib-amavis/.spamassassin &gt; /dev/null</span><span class="w"></span>
<span class="c1">#</span><span class="w"></span>
<span class="c1"># Everyday 3:00AM, learn spam from all users of a domain</span><span class="w"></span>
<span class="c1"># spam: junk directory</span><span class="w"></span>
<span class="na">0 3 * * * root sa-learn --spam /var/mail/not-example.com/*/.Junk --dbpath /var/mail-state/lib-amavis/.spamassassin</span><span class="w"></span>
<span class="na">0 3 * * * root sa-learn --spam /var/mail/not-example.com/*/.Junk --dbpath /var/mail-state/lib-amavis/.spamassassin &gt; /dev/null</span><span class="w"></span>
<span class="c1"># ham: archive directories</span><span class="w"></span>
<span class="na">15 3 * * * root sa-learn --ham /var/mail/not-example.com/*/.Archive* --dbpath /var/mail-state/lib-amavis/.spamassassin</span><span class="w"></span>
<span class="na">15 3 * * * root sa-learn --ham /var/mail/not-example.com/*/.Archive* --dbpath /var/mail-state/lib-amavis/.spamassassin &gt; /dev/null</span><span class="w"></span>
<span class="c1"># ham: inbox subdirectories</span><span class="w"></span>
<span class="na">30 3 * * * root sa-learn --ham /var/mail/not-example.com/*/cur* --dbpath /var/mail-state/lib-amavis/.spamassassin</span><span class="w"></span>
<span class="na">30 3 * * * root sa-learn --ham /var/mail/not-example.com/*/cur* --dbpath /var/mail-state/lib-amavis/.spamassassin &gt; /dev/null</span><span class="w"></span>
</code></pre></div>
<p>Then with <code>docker-compose.yml</code>:</p>
<div class="highlight"><pre><span></span><code><span class="nt">services</span><span class="p">:</span><span class="w"></span>

File diff suppressed because one or more lines are too long

View file

@ -2,212 +2,212 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/faq/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/introduction/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/environment/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/pop3/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/setup.sh/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/advanced/auth-ldap/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/advanced/dovecot-master-accounts/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/advanced/full-text-search/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/advanced/ipv6/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/advanced/kubernetes/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/advanced/mail-fetchmail/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/advanced/mail-sieve/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/advanced/optional-config/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/advanced/podman/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/advanced/mail-forwarding/aws-ses/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/advanced/mail-forwarding/relay-hosts/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/advanced/maintenance/update-and-cleanup/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/advanced/override-defaults/dovecot/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/advanced/override-defaults/postfix/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/advanced/override-defaults/user-patches/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/best-practices/autodiscover/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/best-practices/dkim/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/best-practices/dmarc/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/best-practices/spf/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/security/fail2ban/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/security/mail_crypt/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/security/ssl/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/security/understanding-the-ports/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/troubleshooting/debugging/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/user-management/accounts/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/config/user-management/aliases/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/contributing/coding-style/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/contributing/documentation/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/contributing/issues-and-pull-requests/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/contributing/tests/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/examples/tutorials/basic-installation/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/examples/tutorials/blog-posts/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/examples/tutorials/docker-build/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/examples/tutorials/mailserver-behind-proxy/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/examples/use-cases/forward-only-mailserver-with-ldap-authentication/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docker-mailserver.github.io/docker-mailserver/edge/examples/use-cases/imap-folders/</loc>
<lastmod>2022-07-27</lastmod>
<lastmod>2022-08-02</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>