index.html 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <!DOCTYPE html>
  2. <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
  3. <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <link rel="shortcut icon" href="../img/favicon.ico">
  9. <title>First Steps - mailcow: dockerized</title>
  10. <link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
  11. <link rel="stylesheet" href="../css/theme.css" type="text/css" />
  12. <link rel="stylesheet" href="../css/theme_extra.css" type="text/css" />
  13. <link rel="stylesheet" href="../css/highlight.css">
  14. <script>
  15. // Current page data
  16. var mkdocs_page_name = "First Steps";
  17. var mkdocs_page_input_path = "first_steps.md";
  18. var mkdocs_page_url = "/first_steps/";
  19. </script>
  20. <script src="../js/jquery-2.1.1.min.js"></script>
  21. <script src="../js/modernizr-2.8.3.min.js"></script>
  22. <script type="text/javascript" src="../js/highlight.pack.js"></script>
  23. </head>
  24. <body class="wy-body-for-nav" role="document">
  25. <div class="wy-grid-for-nav">
  26. <nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
  27. <div class="wy-side-nav-search">
  28. <a href=".." class="icon icon-home"> mailcow: dockerized</a>
  29. <div role="search">
  30. <form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
  31. <input type="text" name="q" placeholder="Search docs" />
  32. </form>
  33. </div>
  34. </div>
  35. <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
  36. <ul class="current">
  37. <li>
  38. <li class="toctree-l1 ">
  39. <a class="" href="..">Overview</a>
  40. </li>
  41. <li>
  42. <li>
  43. <li class="toctree-l1 ">
  44. <a class="" href="../install/">Installation</a>
  45. </li>
  46. <li>
  47. <li>
  48. <li class="toctree-l1 current">
  49. <a class="current" href="./">First Steps</a>
  50. <ul>
  51. <li class="toctree-l3"><a href="#change-default-language">Change default language</a></li>
  52. <li class="toctree-l3"><a href="#ssl-and-how-to-use-lets-encrypt">SSL (and: How to use Let's Encrypt)</a></li>
  53. <li><a class="toctree-l4" href="#obtain-multi-san-certificate-by-lets-encrypt">Obtain multi-SAN certificate by Let's Encrypt</a></li>
  54. <li class="toctree-l3"><a href="#rspamd-ui-access">Rspamd UI access</a></li>
  55. </ul>
  56. </li>
  57. <li>
  58. <li>
  59. <li class="toctree-l1 ">
  60. <a class="" href="../u_and_e/">Usage & Examples</a>
  61. </li>
  62. <li>
  63. </ul>
  64. </div>
  65. &nbsp;
  66. </nav>
  67. <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
  68. <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
  69. <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
  70. <a href="..">mailcow: dockerized</a>
  71. </nav>
  72. <div class="wy-nav-content">
  73. <div class="rst-content">
  74. <div role="navigation" aria-label="breadcrumbs navigation">
  75. <ul class="wy-breadcrumbs">
  76. <li><a href="..">Docs</a> &raquo;</li>
  77. <li>First Steps</li>
  78. <li class="wy-breadcrumbs-aside">
  79. <a href="https://github.com/andryyy/mailcow-dockerized/edit/master/docs/first_steps.md"
  80. class="icon icon-github"> Edit on GitHub</a>
  81. </li>
  82. </ul>
  83. <hr/>
  84. </div>
  85. <div role="main">
  86. <div class="section">
  87. <h1 id="change-default-language">Change default language</h1>
  88. <p>Change <code>data/conf/sogo/sogo.conf</code> and replace English by your language.</p>
  89. <p>Create a file <code>data/web/inc/vars.local.inc.php</code> and add "DEFAULT_LANG" with either "en", "pt", "de" or "nl":</p>
  90. <pre><code>&lt;?php
  91. $DEFAULT_LANG = &quot;de&quot;;
  92. </code></pre>
  93. <h1 id="ssl-and-how-to-use-lets-encrypt">SSL (and: How to use Let's Encrypt)</h1>
  94. <p>mailcow dockerized comes with a snakeoil CA "mailcow" and a server certificate in <code>data/assets/ssl</code>. Please use your own trusted certificates.</p>
  95. <p>mailcow uses 3 domain names that should be covered by your new certificate:</p>
  96. <ul>
  97. <li>${MAILCOW_HOSTNAME}</li>
  98. <li>autodiscover.<em>example.org</em></li>
  99. <li>autoconfig.<em>example.org</em></li>
  100. </ul>
  101. <h2 id="obtain-multi-san-certificate-by-lets-encrypt">Obtain multi-SAN certificate by Let's Encrypt</h2>
  102. <p>This is just an example of how to obtain certificates with certbot. There are several methods!</p>
  103. <ol>
  104. <li>Get the certbot client:</li>
  105. </ol>
  106. <pre><code>wget https://dl.eff.org/certbot-auto -O /usr/local/sbin/certbot &amp;&amp; chmod +x /usr/local/sbin/certbot
  107. </code></pre>
  108. <ol>
  109. <li>
  110. <p>Make sure you set <code>HTTP_BIND=0.0.0.0</code> in <code>mailcow.conf</code> or setup a reverse proxy to enable connections to port 80. If you changed HTTP_BIND, then restart Nginx: <code>docker-compose restart nginx-mailcow</code>.</p>
  111. </li>
  112. <li>
  113. <p>Request the certificate with the webroot method:</p>
  114. </li>
  115. </ol>
  116. <pre><code>cd /path/to/git/clone/mailcow-dockerized
  117. source mailcow.conf
  118. certbot certonly \
  119. --webroot \
  120. -w ${PWD}/data/web \
  121. -d ${MAILCOW_HOSTNAME} \
  122. -d autodiscover.example.org \
  123. -d autoconfig.example.org \
  124. --email you@example.org \
  125. --agree-tos
  126. </code></pre>
  127. <ol>
  128. <li>Create hard links to the full path of the new certificates. Assuming you are still in the mailcow root folder:</li>
  129. </ol>
  130. <pre><code>mv data/assets/ssl/cert.{pem,pem.backup}
  131. mv data/assets/ssl/key.{pem,pem.backup}
  132. ln $(readlink -f /etc/letsencrypt/live/${MAILCOW_HOSTNAME}/fullchain.pem) data/assets/ssl/cert.pem
  133. ln $(readlink -f /etc/letsencrypt/live/${MAILCOW_HOSTNAME}/privkey.pem) data/assets/ssl/key.pem
  134. </code></pre>
  135. <ol>
  136. <li>Restart containers which use the certificate:</li>
  137. </ol>
  138. <pre><code>docker-compose restart postfix-mailcow dovecot-mailcow nginx-mailcow
  139. </code></pre>
  140. <p>When renewing certificates, run the last two steps (link + restart) as post-hook in a script.</p>
  141. <h1 id="rspamd-ui-access">Rspamd UI access</h1>
  142. <p>At first you may want to setup Rspamds web interface which provides some useful features and information.</p>
  143. <ol>
  144. <li>Generate a Rspamd controller password hash:</li>
  145. </ol>
  146. <pre><code>docker-compose exec rspamd-mailcow rspamadm pw
  147. </code></pre>
  148. <ol>
  149. <li>Replace the default hash in <code>data/conf/rspamd/override.d/worker-controller.inc</code> by your newly generated:</li>
  150. </ol>
  151. <pre><code>enable_password = &quot;myhash&quot;;
  152. </code></pre>
  153. <ol>
  154. <li>Restart rspamd:</li>
  155. </ol>
  156. <pre><code>docker-compose restart rspamd-mailcow
  157. </code></pre>
  158. <p>Open https://${MAILCOW_HOSTNAME}/rspamd in a browser and login!</p>
  159. </div>
  160. </div>
  161. <footer>
  162. <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
  163. <a href="../u_and_e/" class="btn btn-neutral float-right" title="Usage & Examples">Next <span class="icon icon-circle-arrow-right"></span></a>
  164. <a href="../install/" class="btn btn-neutral" title="Installation"><span class="icon icon-circle-arrow-left"></span> Previous</a>
  165. </div>
  166. <hr/>
  167. <div role="contentinfo">
  168. <!-- Copyright etc -->
  169. </div>
  170. Built with <a href="http://www.mkdocs.org">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
  171. </footer>
  172. </div>
  173. </div>
  174. </section>
  175. </div>
  176. <div class="rst-versions" role="note" style="cursor: pointer">
  177. <span class="rst-current-version" data-toggle="rst-current-version">
  178. <a href="https://github.com/andryyy/mailcow-dockerized/" class="icon icon-github" style="float: left; color: #fcfcfc"> GitHub</a>
  179. <span><a href="../install/" style="color: #fcfcfc;">&laquo; Previous</a></span>
  180. <span style="margin-left: 15px"><a href="../u_and_e/" style="color: #fcfcfc">Next &raquo;</a></span>
  181. </span>
  182. </div>
  183. <script src="../js/theme.js"></script>
  184. </body>
  185. </html>