1058 Zeilen
50 KiB
HTML
1058 Zeilen
50 KiB
HTML
|
|
|||
|
<!DOCTYPE html>
|
|||
|
<html class="no-js">
|
|||
|
<head>
|
|||
|
|
|||
|
<meta charset="utf-8">
|
|||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<link rel="shortcut icon" href="../assets/images/favicon.png">
|
|||
|
|
|||
|
<meta name="generator" content="mkdocs-0.16.1, mkdocs-material-1.2.0">
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<title>Usage & Examples - mailcow: dockerized</title>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<script src="../assets/javascripts/modernizr-56ade86843.js"></script>
|
|||
|
|
|||
|
|
|||
|
<link rel="stylesheet" href="../assets/stylesheets/application-e17eeafcbc.css">
|
|||
|
|
|||
|
<link rel="stylesheet" href="../assets/stylesheets/application-892b79c5c5.palette.css">
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
|||
|
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
|||
|
|
|||
|
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</head>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<body data-md-color-primary="indigo" data-md-color-accent="yellow">
|
|||
|
|
|||
|
<svg class="md-svg">
|
|||
|
<defs>
|
|||
|
|
|||
|
|
|||
|
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg>
|
|||
|
|
|||
|
</defs>
|
|||
|
</svg>
|
|||
|
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="drawer">
|
|||
|
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="search">
|
|||
|
<label class="md-overlay" data-md-component="overlay" for="drawer"></label>
|
|||
|
|
|||
|
<header class="md-header">
|
|||
|
<nav class="md-header-nav md-grid">
|
|||
|
<div class="md-flex">
|
|||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
|||
|
|
|||
|
<a href=".." title="mailcow: dockerized" class="md-logo md-header-nav__button">
|
|||
|
<img src="../images/logo.svg" width="24" height="24">
|
|||
|
</a>
|
|||
|
|
|||
|
</div>
|
|||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
|||
|
<label class="md-icon md-icon--menu md-header-nav__button" for="drawer"></label>
|
|||
|
</div>
|
|||
|
<div class="md-flex__cell md-flex__cell--stretch">
|
|||
|
<span class="md-flex__ellipsis md-header-nav__title">
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
Usage & Examples
|
|||
|
|
|||
|
</span>
|
|||
|
</div>
|
|||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
|||
|
|
|||
|
<label class="md-icon md-icon--search md-header-nav__button" for="search"></label>
|
|||
|
|
|||
|
<div class="md-search" data-md-component="search">
|
|||
|
<div class="md-search__overlay"></div>
|
|||
|
<div class="md-search__inner">
|
|||
|
<form class="md-search__form" name="search">
|
|||
|
<input type="text" class="md-search__input" name="query" placeholder="Search" accesskey="s" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query">
|
|||
|
<label class="md-icon md-search__icon" for="search"></label>
|
|||
|
</form>
|
|||
|
<div class="md-search__output">
|
|||
|
<div class="md-search__scrollwrap" data-md-scrollfix>
|
|||
|
<div class="md-search-result" data-md-component="result"></div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
|||
|
<div class="md-header-nav__source">
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<a href="https://github.com/mailcow/mailcow-dockerized-docs" title="Go to repository" class="md-source" data-md-source="github">
|
|||
|
|
|||
|
<div class="md-source__icon">
|
|||
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
|||
|
<use xlink:href="#github" width="24" height="24"></use>
|
|||
|
</svg>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="md-source__repository">
|
|||
|
GitHub
|
|||
|
</div>
|
|||
|
</a>
|
|||
|
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</nav>
|
|||
|
</header>
|
|||
|
|
|||
|
<div class="md-container">
|
|||
|
|
|||
|
|
|||
|
<main class="md-main">
|
|||
|
<div class="md-main__inner md-grid" data-md-component="container">
|
|||
|
|
|||
|
|
|||
|
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
|
|||
|
<div class="md-sidebar__scrollwrap">
|
|||
|
<div class="md-sidebar__inner">
|
|||
|
<nav class="md-nav md-nav--primary" data-md-level="0">
|
|||
|
<label class="md-nav__title md-nav__title--site" for="drawer">
|
|||
|
|
|||
|
<i class="md-logo md-nav__button">
|
|||
|
<img src="../images/logo.svg">
|
|||
|
</i>
|
|||
|
|
|||
|
mailcow: dockerized
|
|||
|
</label>
|
|||
|
|
|||
|
<div class="md-nav__source">
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<a href="https://github.com/mailcow/mailcow-dockerized-docs" title="Go to repository" class="md-source" data-md-source="github">
|
|||
|
|
|||
|
<div class="md-source__icon">
|
|||
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
|||
|
<use xlink:href="#github" width="24" height="24"></use>
|
|||
|
</svg>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="md-source__repository">
|
|||
|
GitHub
|
|||
|
</div>
|
|||
|
</a>
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
<ul class="md-nav__list" data-md-scrollfix>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href=".." title="This is mailcow" class="md-nav__link">
|
|||
|
This is mailcow
|
|||
|
</a>
|
|||
|
</li>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="../install/" title="Installation" class="md-nav__link">
|
|||
|
Installation
|
|||
|
</a>
|
|||
|
</li>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="../first_steps/" title="First Steps" class="md-nav__link">
|
|||
|
First Steps
|
|||
|
</a>
|
|||
|
</li>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<li class="md-nav__item md-nav__item--active">
|
|||
|
|
|||
|
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="toc">
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<a href="./" title="Usage & Examples" class="md-nav__link md-nav__link--active">
|
|||
|
Usage & Examples
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
|
|||
|
</ul>
|
|||
|
</nav>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
|
|||
|
<div class="md-sidebar__scrollwrap">
|
|||
|
<div class="md-sidebar__inner">
|
|||
|
|
|||
|
<nav class="md-nav md-nav--secondary">
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<label class="md-nav__title" for="toc">Table of contents</label>
|
|||
|
<ul class="md-nav__list" data-md-scrollfix>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#mailcow-ui-configuration" title="mailcow UI configuration" class="md-nav__link">
|
|||
|
mailcow UI configuration
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#anonymize-headers" title="Anonymize headers" class="md-nav__link">
|
|||
|
Anonymize headers
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#backup-and-restore-maildir-simple-tar-file" title="Backup and restore maildir (simple tar file)" class="md-nav__link">
|
|||
|
Backup and restore maildir (simple tar file)
|
|||
|
</a>
|
|||
|
|
|||
|
<nav class="md-nav">
|
|||
|
<ul class="md-nav__list">
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#backup" title="Backup" class="md-nav__link">
|
|||
|
Backup
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#restore" title="Restore" class="md-nav__link">
|
|||
|
Restore
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
</ul>
|
|||
|
</nav>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#docker-compose-bash-completion" title="Docker Compose Bash completion" class="md-nav__link">
|
|||
|
Docker Compose Bash completion
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#black-and-whitelist" title="Black and Whitelist" class="md-nav__link">
|
|||
|
Black and Whitelist
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#customize-dockerfiles" title="Customize Dockerfiles" class="md-nav__link">
|
|||
|
Customize Dockerfiles
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#disable-sender-addresses-verification" title="Disable sender addresses verification" class="md-nav__link">
|
|||
|
Disable sender addresses verification
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#install-roundcube" title="Install Roundcube" class="md-nav__link">
|
|||
|
Install Roundcube
|
|||
|
</a>
|
|||
|
|
|||
|
<nav class="md-nav">
|
|||
|
<ul class="md-nav__list">
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#enable-change-password-function-in-roundcube" title="Enable change password function in Roundcube" class="md-nav__link">
|
|||
|
Enable change password function in Roundcube
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
</ul>
|
|||
|
</nav>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#mysql" title="MySQL" class="md-nav__link">
|
|||
|
MySQL
|
|||
|
</a>
|
|||
|
|
|||
|
<nav class="md-nav">
|
|||
|
<ul class="md-nav__list">
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#connect" title="Connect" class="md-nav__link">
|
|||
|
Connect
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#backup_1" title="Backup" class="md-nav__link">
|
|||
|
Backup
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#restore_1" title="Restore" class="md-nav__link">
|
|||
|
Restore
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#reset-mysql-passwords" title="Reset MySQL passwords" class="md-nav__link">
|
|||
|
Reset MySQL passwords
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
</ul>
|
|||
|
</nav>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#debugging" title="Debugging" class="md-nav__link">
|
|||
|
Debugging
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#redirect-port-80-to-443" title="Redirect port 80 to 443" class="md-nav__link">
|
|||
|
Redirect port 80 to 443
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#redis" title="Redis" class="md-nav__link">
|
|||
|
Redis
|
|||
|
</a>
|
|||
|
|
|||
|
<nav class="md-nav">
|
|||
|
<ul class="md-nav__list">
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#client" title="Client" class="md-nav__link">
|
|||
|
Client
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
</ul>
|
|||
|
</nav>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#remove-persistent-data" title="Remove persistent data" class="md-nav__link">
|
|||
|
Remove persistent data
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#reset-admin-password" title="Reset admin password" class="md-nav__link">
|
|||
|
Reset admin password
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#rspamd" title="Rspamd" class="md-nav__link">
|
|||
|
Rspamd
|
|||
|
</a>
|
|||
|
|
|||
|
<nav class="md-nav">
|
|||
|
<ul class="md-nav__list">
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#learn-spam-and-ham" title="Learn spam and ham" class="md-nav__link">
|
|||
|
Learn spam and ham
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#learn-ham-or-spam-from-existing-directory" title="Learn ham or spam from existing directory" class="md-nav__link">
|
|||
|
Learn ham or spam from existing directory
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#cli-tools" title="CLI tools" class="md-nav__link">
|
|||
|
CLI tools
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
</ul>
|
|||
|
</nav>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#adjust-service-configurations" title="Adjust service configurations" class="md-nav__link">
|
|||
|
Adjust service configurations
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#tagging" title="Tagging" class="md-nav__link">
|
|||
|
Tagging
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#two-factor-authentication" title="Two-factor authentication" class="md-nav__link">
|
|||
|
Two-factor authentication
|
|||
|
</a>
|
|||
|
|
|||
|
<nav class="md-nav">
|
|||
|
<ul class="md-nav__list">
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#yubi-otp" title="Yubi OTP" class="md-nav__link">
|
|||
|
Yubi OTP
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#u2f" title="U2F" class="md-nav__link">
|
|||
|
U2F
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
</ul>
|
|||
|
</nav>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#portainer" title="Portainer" class="md-nav__link">
|
|||
|
Portainer
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#change-autodiscover-setup-type" title="Change autodiscover setup type" class="md-nav__link">
|
|||
|
Change autodiscover setup type
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
<li class="md-nav__item">
|
|||
|
<a href="#why-bind" title="Why Bind?" class="md-nav__link">
|
|||
|
Why Bind?
|
|||
|
</a>
|
|||
|
|
|||
|
</li>
|
|||
|
|
|||
|
</ul>
|
|||
|
|
|||
|
</nav>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
<div class="md-content">
|
|||
|
<article class="md-content__inner md-typeset">
|
|||
|
|
|||
|
<a href="https://github.com/mailcow/mailcow-dockerized-docs/edit/master/docs/u_and_e.md" title="Edit this page" class="md-icon md-content__edit">edit</a>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<h1>Usage & Examples</h1>
|
|||
|
|
|||
|
<h2 id="mailcow-ui-configuration">mailcow UI configuration<a class="headerlink" href="#mailcow-ui-configuration" title="Permanent link">¶</a></h2>
|
|||
|
<p>Several configuration parameters of the mailcow UI can be changed by creating a file <code>data/web/inc/vars.local.inc.php</code> which overrides defaults settings found in <code>data/web/inc/vars.inc.php</code>.</p>
|
|||
|
<p>The local configuration file is persistent over updates of mailcow. Try not to change values inside <code>data/web/inc/vars.inc.php</code>, but use them as template for the local override.</p>
|
|||
|
<p>mailcow UI configuration parameters can be to...</p>
|
|||
|
<ul>
|
|||
|
<li>...change the default language*</li>
|
|||
|
<li>...change the default bootstrap theme</li>
|
|||
|
<li>...set a password complexity regex</li>
|
|||
|
<li>...add mailcow app buttons to the login screen</li>
|
|||
|
<li>...set a pagination trigger</li>
|
|||
|
<li>...set action after submitting forms (stay in form, return to previous page)</li>
|
|||
|
</ul>
|
|||
|
<p>* To change SOGos default language, you will need to edit <code>data/conf/sogo/sogo.conf</code> and replace "English" by your preferred language.</p>
|
|||
|
<h2 id="anonymize-headers">Anonymize headers<a class="headerlink" href="#anonymize-headers" title="Permanent link">¶</a></h2>
|
|||
|
<p>Save as <code>data/conf/postfix/mailcow_anonymize_headers.pcre</code>:</p>
|
|||
|
<div class="codehilite"><pre><span></span>/^\s*Received:[^\)]+\)\s+\(Authenticated sender:(.+)/
|
|||
|
REPLACE Received: from localhost (localhost [127.0.0.1]) (Authenticated sender:$1
|
|||
|
/^\s*User-Agent/ IGNORE
|
|||
|
/^\s*X-Enigmail/ IGNORE
|
|||
|
/^\s*X-Mailer/ IGNORE
|
|||
|
/^\s*X-Originating-IP/ IGNORE
|
|||
|
/^\s*X-Forward/ IGNORE
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<p>Add this to <code>data/conf/postfix/main.cf</code>:</p>
|
|||
|
<div class="codehilite"><pre><span></span>smtp_header_checks = pcre:/opt/postfix/conf/mailcow_anonymize_headers.pcre
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<h2 id="backup-and-restore-maildir-simple-tar-file">Backup and restore maildir (simple tar file)<a class="headerlink" href="#backup-and-restore-maildir-simple-tar-file" title="Permanent link">¶</a></h2>
|
|||
|
<h3 id="backup">Backup<a class="headerlink" href="#backup" title="Permanent link">¶</a></h3>
|
|||
|
<p>This line backups the vmail directory to a file backup_vmail.tar.gz in the mailcow root directory:</p>
|
|||
|
<div class="codehilite"><pre><span></span>cd /path/to/mailcow-dockerized
|
|||
|
source mailcow.conf
|
|||
|
DATE=$(date +"%Y%m%d_%H%M%S")
|
|||
|
docker run --rm -it -v $(docker inspect --format '{{ range .Mounts }}{{ if eq .Destination "/var/vmail" }}{{ .Name }}{{ end }}{{ end }}' $(docker-compose ps -q dovecot-mailcow)):/vmail -v <span class="cp">${</span><span class="n">PWD</span><span class="cp">}</span>:/backup debian:jessie tar cvfz /backup/backup_vmail.tar.gz /vmail
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<p>You can change the path by adjusting ${PWD} (which equals to the current directory) to any path you have write-access to.
|
|||
|
Set the filename <code>backup_vmail.tar.gz</code> to any custom name, but leave the path as it is. Example: <code>[...] tar cvfz /backup/my_own_filename_.tar.gz</code></p>
|
|||
|
<h3 id="restore">Restore<a class="headerlink" href="#restore" title="Permanent link">¶</a></h3>
|
|||
|
<div class="codehilite"><pre><span></span>cd /path/to/mailcow-dockerized
|
|||
|
source mailcow.conf
|
|||
|
DATE=$(date +"%Y%m%d_%H%M%S")
|
|||
|
docker run --rm -it -v $(docker inspect --format '{{ range .Mounts }}{{ if eq .Destination "/var/vmail" }}{{ .Name }}{{ end }}{{ end }}' $(docker-compose ps -q dovecot-mailcow)):/vmail -v <span class="cp">${</span><span class="n">PWD</span><span class="cp">}</span>:/backup debian:jessie tar xvfz /backup/backup_vmail.tar.gz
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<h2 id="docker-compose-bash-completion">Docker Compose Bash completion<a class="headerlink" href="#docker-compose-bash-completion" title="Permanent link">¶</a></h2>
|
|||
|
<p>For the tab-tab... :-)</p>
|
|||
|
<div class="codehilite"><pre><span></span>curl -L https://raw.githubusercontent.com/docker/compose/$(docker-compose version --short)/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<h2 id="black-and-whitelist">Black and Whitelist<a class="headerlink" href="#black-and-whitelist" title="Permanent link">¶</a></h2>
|
|||
|
<p>Edit a domain as (domain) administrator to add an item to the filter table.</p>
|
|||
|
<p>Beware that a mailbox user can login to mailcow and override a domain policy filter item. </p>
|
|||
|
<h2 id="customize-dockerfiles">Customize Dockerfiles<a class="headerlink" href="#customize-dockerfiles" title="Permanent link">¶</a></h2>
|
|||
|
<p>Make your changes in <code>data/Dockerfiles/$service</code> and build the image locally:</p>
|
|||
|
<div class="codehilite"><pre><span></span>docker build data/Dockerfiles/service -t mailcow/$service
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<p>Now auto-recreate modified containers:</p>
|
|||
|
<div class="codehilite"><pre><span></span>docker-compose up -d
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<h2 id="disable-sender-addresses-verification">Disable sender addresses verification<a class="headerlink" href="#disable-sender-addresses-verification" title="Permanent link">¶</a></h2>
|
|||
|
<p>This option is not best-practice and should only be implemented when there is no other option available to archive whatever you are trying to do.</p>
|
|||
|
<p>Simply create a file <code>data/conf/postfix/check_sasl_access</code> and enter the following content. This user must exist in your installation and needs to authenticate before sending mail.</p>
|
|||
|
<div class="codehilite"><pre><span></span>user-to-allow-everything@example.com OK
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<p>Open <code>data/conf/postfix/main.cf</code> and find <code>smtpd_sender_restrictions</code>. Prepend <code>check_sasl_access hash:/opt/postfix/conf/check_sasl_access</code> like this:</p>
|
|||
|
<div class="codehilite"><pre><span></span>smtpd_sender_restrictions = check_sasl_access hash:/opt/postfix/conf/check_sasl_access reject_authenticated_sender_login_mismatch [...]
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<p>Run postmap on check_sasl_access:</p>
|
|||
|
<div class="codehilite"><pre><span></span>docker-compose exec postfix-mailcow postmap /opt/postfix/conf/check_sasl_access
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<p>Restart the Postfix container.</p>
|
|||
|
<h2 id="install-roundcube">Install Roundcube<a class="headerlink" href="#install-roundcube" title="Permanent link">¶</a></h2>
|
|||
|
<p>Download Roundcube 1.3.x (beta at the time of Feb 2017) to the web htdocs directory and extract it (here <code>rc/</code>):</p>
|
|||
|
<div class="codehilite"><pre><span></span>cd data/web/rc
|
|||
|
wget -O - https://github.com/roundcube/roundcubemail/releases/download/1.3-beta/roundcubemail-1.3-beta-complete.tar.gz | tar xfvz -
|
|||
|
# Change folder name
|
|||
|
mv roundcubemail-1.3* rc
|
|||
|
# Change permissions
|
|||
|
chown -R root: rc/
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<p>Create a file <code>data/web/rc/config/config.inc.php</code> with the following content.</p>
|
|||
|
<p><strong>Change the <code>des_key</code> parameter to a random value.</strong> It is used to temporarily store your IMAP password.</p>
|
|||
|
<div class="codehilite"><pre><span></span><span class="cp"><?php</span>
|
|||
|
<span class="nb">error_reporting</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span>
|
|||
|
<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nb">file_exists</span><span class="p">(</span><span class="s1">'/tmp/mime.types'</span><span class="p">))</span> <span class="p">{</span>
|
|||
|
<span class="nb">file_put_contents</span><span class="p">(</span><span class="s2">"/tmp/mime.types"</span><span class="p">,</span> <span class="nb">fopen</span><span class="p">(</span><span class="s2">"http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types"</span><span class="p">,</span> <span class="s1">'r'</span><span class="p">));</span>
|
|||
|
<span class="p">}</span>
|
|||
|
<span class="nv">$config</span> <span class="o">=</span> <span class="k">array</span><span class="p">();</span>
|
|||
|
<span class="nv">$config</span><span class="p">[</span><span class="s1">'db_dsnw'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'mysql://'</span> <span class="o">.</span> <span class="nb">getenv</span><span class="p">(</span><span class="s1">'DBUSER'</span><span class="p">)</span> <span class="o">.</span> <span class="s1">':'</span> <span class="o">.</span> <span class="nb">getenv</span><span class="p">(</span><span class="s1">'DBPASS'</span><span class="p">)</span> <span class="o">.</span> <span class="s1">'@mysql/'</span> <span class="o">.</span> <span class="nb">getenv</span><span class="p">(</span><span class="s1">'DBNAME'</span><span class="p">);</span>
|
|||
|
<span class="nv">$config</span><span class="p">[</span><span class="s1">'default_host'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'tls://dovecot'</span><span class="p">;</span>
|
|||
|
<span class="nv">$config</span><span class="p">[</span><span class="s1">'default_port'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'143'</span><span class="p">;</span>
|
|||
|
<span class="nv">$config</span><span class="p">[</span><span class="s1">'smtp_server'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'tls://postfix'</span><span class="p">;</span>
|
|||
|
<span class="nv">$config</span><span class="p">[</span><span class="s1">'smtp_port'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">587</span><span class="p">;</span>
|
|||
|
<span class="nv">$config</span><span class="p">[</span><span class="s1">'smtp_user'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'%u'</span><span class="p">;</span>
|
|||
|
<span class="nv">$config</span><span class="p">[</span><span class="s1">'smtp_pass'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'%p'</span><span class="p">;</span>
|
|||
|
<span class="nv">$config</span><span class="p">[</span><span class="s1">'support_url'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">''</span><span class="p">;</span>
|
|||
|
<span class="nv">$config</span><span class="p">[</span><span class="s1">'product_name'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'Roundcube Webmail'</span><span class="p">;</span>
|
|||
|
<span class="nv">$config</span><span class="p">[</span><span class="s1">'des_key'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'rcmail-!24ByteDESkey*Str'</span><span class="p">;</span>
|
|||
|
<span class="nv">$config</span><span class="p">[</span><span class="s1">'log_dir'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'/dev/null'</span><span class="p">;</span>
|
|||
|
<span class="nv">$config</span><span class="p">[</span><span class="s1">'temp_dir'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'/tmp'</span><span class="p">;</span>
|
|||
|
<span class="nv">$config</span><span class="p">[</span><span class="s1">'plugins'</span><span class="p">]</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span>
|
|||
|
<span class="s1">'archive'</span><span class="p">,</span>
|
|||
|
<span class="p">);</span>
|
|||
|
<span class="nv">$config</span><span class="p">[</span><span class="s1">'skin'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'larry'</span><span class="p">;</span>
|
|||
|
<span class="nv">$config</span><span class="p">[</span><span class="s1">'mime_types'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'/tmp/mime.types'</span><span class="p">;</span>
|
|||
|
<span class="nv">$config</span><span class="p">[</span><span class="s1">'imap_conn_options'</span><span class="p">]</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span>
|
|||
|
<span class="s1">'ssl'</span> <span class="o">=></span> <span class="k">array</span><span class="p">(</span><span class="s1">'verify_peer'</span> <span class="o">=></span> <span class="k">false</span><span class="p">,</span> <span class="s1">'verify_peer_name'</span> <span class="o">=></span> <span class="k">false</span><span class="p">,</span> <span class="s1">'allow_self_signed'</span> <span class="o">=></span> <span class="k">true</span><span class="p">)</span>
|
|||
|
<span class="p">);</span>
|
|||
|
<span class="nv">$config</span><span class="p">[</span><span class="s1">'enable_installer'</span><span class="p">]</span> <span class="o">=</span> <span class="k">false</span><span class="p">;</span>
|
|||
|
<span class="nv">$config</span><span class="p">[</span><span class="s1">'smtp_conn_options'</span><span class="p">]</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span>
|
|||
|
<span class="s1">'ssl'</span> <span class="o">=></span> <span class="k">array</span><span class="p">(</span><span class="s1">'verify_peer'</span> <span class="o">=></span> <span class="k">false</span><span class="p">,</span> <span class="s1">'verify_peer_name'</span> <span class="o">=></span> <span class="k">false</span><span class="p">,</span> <span class="s1">'allow_self_signed'</span> <span class="o">=></span> <span class="k">true</span><span class="p">)</span>
|
|||
|
<span class="p">);</span>
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<p>Point your browser to <code>https://myserver/rc/installer</code> and follow the instructions.
|
|||
|
Initialize the database and leave the installer.</p>
|
|||
|
<p><strong>Delete the directory <code>data/web/rc/installer</code> after a successful installation!</strong></p>
|
|||
|
<h3 id="enable-change-password-function-in-roundcube">Enable change password function in Roundcube<a class="headerlink" href="#enable-change-password-function-in-roundcube" title="Permanent link">¶</a></h3>
|
|||
|
<p>Open <code>data/web/rc/config/config.inc.php</code> and enable the password plugin:</p>
|
|||
|
<div class="codehilite"><pre><span></span>...
|
|||
|
$config['plugins'] = array(
|
|||
|
'archive',
|
|||
|
'password',
|
|||
|
);
|
|||
|
...
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<p>Open <code>data/web/rc/plugins/password/password.php</code>, search for <code>case 'ssha':</code> and add above:</p>
|
|||
|
<div class="codehilite"><pre><span></span> <span class="nt">case</span> <span class="s1">'ssha256'</span><span class="o">:</span>
|
|||
|
<span class="o">$</span><span class="nt">salt</span> <span class="o">=</span> <span class="nt">rcube_utils</span><span class="p">::</span><span class="nd">random_bytes</span><span class="o">(</span><span class="nt">8</span><span class="o">);</span>
|
|||
|
<span class="o">$</span><span class="nt">crypted</span> <span class="o">=</span> <span class="nt">base64_encode</span><span class="o">(</span> <span class="nt">hash</span><span class="o">(</span><span class="s1">'sha256'</span><span class="o">,</span> <span class="o">$</span><span class="nt">password</span> <span class="o">.</span> <span class="o">$</span><span class="nt">salt</span><span class="o">,</span> <span class="nt">TRUE</span> <span class="o">)</span> <span class="o">.</span> <span class="o">$</span><span class="nt">salt</span> <span class="o">);</span>
|
|||
|
<span class="o">$</span><span class="nt">prefix</span> <span class="o">=</span> <span class="s1">'{SSHA256}'</span><span class="o">;</span>
|
|||
|
<span class="nt">break</span><span class="o">;</span>
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<p>Open <code>data/web/rc/plugins/password/config.inc.php</code> and change the following parameters (or add them at the bottom of that file):</p>
|
|||
|
<div class="codehilite"><pre><span></span>$config['password_driver'] = 'sql';
|
|||
|
$config['password_algorithm'] = 'ssha256';
|
|||
|
$config['password_algorithm_prefix'] = '{SSHA256}';
|
|||
|
$config['password_query'] = "UPDATE mailbox SET password = %P WHERE username = %u";
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<h2 id="mysql">MySQL<a class="headerlink" href="#mysql" title="Permanent link">¶</a></h2>
|
|||
|
<h3 id="connect">Connect<a class="headerlink" href="#connect" title="Permanent link">¶</a></h3>
|
|||
|
<div class="codehilite"><pre><span></span>source mailcow.conf
|
|||
|
docker-compose exec mysql-mailcow mysql -u<span class="cp">${</span><span class="n">DBUSER</span><span class="cp">}</span> -p<span class="cp">${</span><span class="n">DBPASS</span><span class="cp">}</span> <span class="cp">${</span><span class="n">DBNAME</span><span class="cp">}</span>
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<h3 id="backup_1">Backup<a class="headerlink" href="#backup_1" title="Permanent link">¶</a></h3>
|
|||
|
<div class="codehilite"><pre><span></span>cd /path/to/mailcow-dockerized
|
|||
|
source mailcow.conf
|
|||
|
DATE=$(date +"%Y%m%d_%H%M%S")
|
|||
|
docker-compose exec mysql-mailcow mysqldump --default-character-set=utf8mb4 -u<span class="cp">${</span><span class="n">DBUSER</span><span class="cp">}</span> -p<span class="cp">${</span><span class="n">DBPASS</span><span class="cp">}</span> <span class="cp">${</span><span class="n">DBNAME</span><span class="cp">}</span> > backup_<span class="cp">${</span><span class="n">DBNAME</span><span class="cp">}</span>_<span class="cp">${</span><span class="n">DATE</span><span class="cp">}</span>.sql
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<h3 id="restore_1">Restore<a class="headerlink" href="#restore_1" title="Permanent link">¶</a></h3>
|
|||
|
<div class="codehilite"><pre><span></span>cd /path/to/mailcow-dockerized
|
|||
|
source mailcow.conf
|
|||
|
docker-compose exec mysql-mailcow mysql -u<span class="cp">${</span><span class="n">DBUSER</span><span class="cp">}</span> -p<span class="cp">${</span><span class="n">DBPASS</span><span class="cp">}</span> <span class="cp">${</span><span class="n">DBNAME</span><span class="cp">}</span> <span class="nt">< backup</span><span class="err">_file.sql</span>
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<h3 id="reset-mysql-passwords">Reset MySQL passwords<a class="headerlink" href="#reset-mysql-passwords" title="Permanent link">¶</a></h3>
|
|||
|
<p>Stop the stack by running <code>docker-compose stop</code>.</p>
|
|||
|
<p>When the containers came to a stop, run this command:</p>
|
|||
|
<div class="codehilite"><pre><span></span>docker-compose run --rm --entrypoint '/bin/sh -c "gosu mysql mysqld --skip-grant-tables & sleep 10 && mysql -hlocalhost -uroot && exit 0"' mysql-mailcow
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<p><strong>1. Find database name</strong></p>
|
|||
|
<div class="codehilite"><pre><span></span>MariaDB [(none)]> show databases;
|
|||
|
+--------------------+
|
|||
|
| Database |
|
|||
|
+--------------------+
|
|||
|
| information_schema |
|
|||
|
| mailcow_database | <=====
|
|||
|
| mysql |
|
|||
|
| performance_schema |
|
|||
|
+--------------------+
|
|||
|
4 rows in set (0.00 sec)
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<p><strong>2. Reset one or more users</strong></p>
|
|||
|
<p>Both "password" and "authentication_string" exist. Currently "password" is used, but better set both.</p>
|
|||
|
<div class="codehilite"><pre><span></span>MariaDB [(none)]> SELECT user FROM mysql.user;
|
|||
|
+--------------+
|
|||
|
| user |
|
|||
|
+--------------+
|
|||
|
| mailcow_user | <=====
|
|||
|
| root |
|
|||
|
+--------------+
|
|||
|
2 rows in set (0.00 sec)
|
|||
|
|
|||
|
MariaDB [(none)]> FLUSH PRIVILEGES;
|
|||
|
MariaDB [(none)]> UPDATE mysql.user SET authentication_string = PASSWORD('gotr00t'), password = PASSWORD('gotr00t') WHERE User = 'root' AND Host = '%';
|
|||
|
MariaDB [(none)]> UPDATE mysql.user SET authentication_string = PASSWORD('mookuh'), password = PASSWORD('mookuh') WHERE User = 'mailcow' AND Host = '%';
|
|||
|
MariaDB [(none)]> FLUSH PRIVILEGES;
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<h2 id="debugging">Debugging<a class="headerlink" href="#debugging" title="Permanent link">¶</a></h2>
|
|||
|
<p>You can use <code>docker-compose logs $service-name</code> for all containers.</p>
|
|||
|
<p>Run <code>docker-compose logs</code> for all logs at once.</p>
|
|||
|
<p>Follow the log output by running docker-compose with <code>logs -f</code>.</p>
|
|||
|
<p>Limit the output by calling logs with <code>--tail=300</code> like <code>docker-compose logs --tail=300 mysql-mailcow</code>.</p>
|
|||
|
<h2 id="redirect-port-80-to-443">Redirect port 80 to 443<a class="headerlink" href="#redirect-port-80-to-443" title="Permanent link">¶</a></h2>
|
|||
|
<p>Since February the 28th 2017 mailcow does come with port 80 and 443 enabled.</p>
|
|||
|
<p>Open <code>mailcow.conf</code> and set <code>HTTP_BIND=0.0.0.0</code>.</p>
|
|||
|
<p>Open <code>data/conf/nginx/site.conf</code> and add a new "catch-all" site at the top of that file:</p>
|
|||
|
<div class="codehilite"><pre><span></span><span class="nt">server</span> <span class="p">{</span>
|
|||
|
<span class="err">listen</span> <span class="err">80</span> <span class="err">default_server</span><span class="p">;</span>
|
|||
|
<span class="err">include</span> <span class="err">/etc/nginx/conf.d/server_name.active</span><span class="p">;</span>
|
|||
|
<span class="err">return</span> <span class="err">301</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="err">$</span><span class="n">host</span><span class="err">$</span><span class="n">request_uri</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<p>Restart the stack, changed containers will be updated:</p>
|
|||
|
<p><code>docker-compose up -d</code></p>
|
|||
|
<h2 id="redis">Redis<a class="headerlink" href="#redis" title="Permanent link">¶</a></h2>
|
|||
|
<h3 id="client">Client<a class="headerlink" href="#client" title="Permanent link">¶</a></h3>
|
|||
|
<div class="codehilite"><pre><span></span>docker-compose exec redis-mailcow redis-cli
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<h2 id="remove-persistent-data">Remove persistent data<a class="headerlink" href="#remove-persistent-data" title="Permanent link">¶</a></h2>
|
|||
|
<ul>
|
|||
|
<li>Remove volume <code>mysql-vol-1</code> to remove all MySQL data.</li>
|
|||
|
<li>Remove volume <code>redis-vol-1</code> to remove all Redis data.</li>
|
|||
|
<li>Remove volume <code>vmail-vol-1</code> to remove all contents of <code>/var/vmail</code> mounted to <code>dovecot-mailcow</code>.</li>
|
|||
|
<li>Remove volume <code>dkim-vol-1</code> to remove all DKIM keys.</li>
|
|||
|
<li>Remove volume <code>rspamd-vol-1</code> to remove all Rspamd data.</li>
|
|||
|
</ul>
|
|||
|
<p>Running <code>docker-compose down -v</code> will <strong>destroy all mailcow: dockerized volumes</strong> and delete any related containers.</p>
|
|||
|
<h2 id="reset-admin-password">Reset admin password<a class="headerlink" href="#reset-admin-password" title="Permanent link">¶</a></h2>
|
|||
|
<p>Reset mailcow admin to <code>admin:moohoo</code>:</p>
|
|||
|
<div class="codehilite"><pre><span></span>cd mailcow_path
|
|||
|
bash reset_admin.sh
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<h2 id="rspamd">Rspamd<a class="headerlink" href="#rspamd" title="Permanent link">¶</a></h2>
|
|||
|
<h3 id="learn-spam-and-ham">Learn spam and ham<a class="headerlink" href="#learn-spam-and-ham" title="Permanent link">¶</a></h3>
|
|||
|
<p>Rspamd learns mail as spam or ham when you move a message in or out of the junk folder to any mailbox besides trash.
|
|||
|
This is archived by using the Dovecot plugin "antispam" and a simple parser script.</p>
|
|||
|
<p>Rspamd also auto-learns mail when a high or low score is detected (see https://rspamd.com/doc/configuration/statistic.html#autolearning)</p>
|
|||
|
<p>The bayes statistics are written to Redis as keys <code>BAYES_HAM</code> and <code>BAYES_SPAM</code>.</p>
|
|||
|
<p>You can also use Rspamd's web ui to learn ham and/or spam.</p>
|
|||
|
<h3 id="learn-ham-or-spam-from-existing-directory">Learn ham or spam from existing directory<a class="headerlink" href="#learn-ham-or-spam-from-existing-directory" title="Permanent link">¶</a></h3>
|
|||
|
<p>You can use a one-liner to learn mail in plain-text (uncompressed) format:</p>
|
|||
|
<div class="codehilite"><pre><span></span># Ham
|
|||
|
for file in /my/folder/cur/*; do docker exec -i $(docker-compose ps -q rspamd-mailcow) rspamc learn_ham < $file; done
|
|||
|
# Spam
|
|||
|
for file in /my/folder/.Junk/cur/*; do docker exec -i $(docker-compose ps -q rspamd-mailcow) rspamc learn_spam < $file; done
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<p>Consider attaching a local folder as new volume to <code>rspamd-mailcow</code> in <code>docker-compose.yml</code> and learn given files inside the container. This can be used as workaround to parse compressed data with zcat. Example:</p>
|
|||
|
<div class="codehilite"><pre><span></span>for file in /data/old_mail/.Junk/cur/*; do rspamc learn_spam < zcat $file; done
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<h3 id="cli-tools">CLI tools<a class="headerlink" href="#cli-tools" title="Permanent link">¶</a></h3>
|
|||
|
<div class="codehilite"><pre><span></span>docker-compose exec rspamd-mailcow rspamc --help
|
|||
|
docker-compose exec rspamd-mailcow rspamadm --help
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<p>See <a href="https://rspamd.com/doc/index.html">Rspamd documentation</a></p>
|
|||
|
<h2 id="adjust-service-configurations">Adjust service configurations<a class="headerlink" href="#adjust-service-configurations" title="Permanent link">¶</a></h2>
|
|||
|
<p>The most important configuration files are mounted from the host into the related containers:</p>
|
|||
|
<div class="codehilite"><pre><span></span>data/conf
|
|||
|
âââ bind9
|
|||
|
â  âââ named.conf
|
|||
|
âââ dovecot
|
|||
|
â  âââ dovecot.conf
|
|||
|
â  âââ dovecot-master.passwd
|
|||
|
â  âââ sieve_after
|
|||
|
â  âââ sql
|
|||
|
â  âââ dovecot-dict-sql.conf
|
|||
|
â  âââ dovecot-mysql.conf
|
|||
|
âââ mysql
|
|||
|
â  âââ my.cnf
|
|||
|
âââ nginx
|
|||
|
â  âââ dynmaps.conf
|
|||
|
â  âââ site.conf
|
|||
|
â  âââ templates
|
|||
|
â  âââ listen_plain.template
|
|||
|
â  âââ listen_ssl.template
|
|||
|
â  âââ server_name.template
|
|||
|
âââ pdns
|
|||
|
â  âââ pdns_custom.lua
|
|||
|
â  âââ recursor.conf
|
|||
|
âââ postfix
|
|||
|
â  âââ main.cf
|
|||
|
â  âââ master.cf
|
|||
|
â  âââ postscreen_access.cidr
|
|||
|
â  âââ smtp_dsn_filter
|
|||
|
â  âââ sql
|
|||
|
â  âââ mysql_relay_recipient_maps.cf
|
|||
|
â  âââ mysql_tls_enforce_in_policy.cf
|
|||
|
â  âââ mysql_tls_enforce_out_policy.cf
|
|||
|
â  âââ mysql_virtual_alias_domain_catchall_maps.cf
|
|||
|
â  âââ mysql_virtual_alias_domain_maps.cf
|
|||
|
â  âââ mysql_virtual_alias_maps.cf
|
|||
|
â  âââ mysql_virtual_domains_maps.cf
|
|||
|
â  âââ mysql_virtual_mailbox_maps.cf
|
|||
|
â  âââ mysql_virtual_relay_domain_maps.cf
|
|||
|
â  âââ mysql_virtual_sender_acl.cf
|
|||
|
â  âââ mysql_virtual_spamalias_maps.cf
|
|||
|
âââ rmilter
|
|||
|
â  âââ rmilter.conf
|
|||
|
âââ rspamd
|
|||
|
â  âââ dynmaps
|
|||
|
â  â  âââ authoritative.php
|
|||
|
â  â  âââ settings.php
|
|||
|
â  â  âââ tags.php
|
|||
|
â  â  âââ vars.inc.php -> ../../../web/inc/vars.inc.php
|
|||
|
â  âââ local.d
|
|||
|
â  â  âââ dkim.conf
|
|||
|
â  â  âââ metrics.conf
|
|||
|
â  â  âââ options.inc
|
|||
|
â  â  âââ redis.conf
|
|||
|
â  â  âââ rspamd.conf.local
|
|||
|
â  â  âââ statistic.conf
|
|||
|
â  âââ lua
|
|||
|
â  â  âââ rspamd.local.lua
|
|||
|
â  âââ override.d
|
|||
|
â  âââ logging.inc
|
|||
|
â  âââ worker-controller.inc
|
|||
|
â  âââ worker-normal.inc
|
|||
|
âââ sogo
|
|||
|
âââ sieve.creds
|
|||
|
âââ sogo.conf
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<p>Just change the according configuration file on the host and restart the related service:</p>
|
|||
|
<div class="codehilite"><pre><span></span>docker-compose restart service-mailcow
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<h2 id="tagging">Tagging<a class="headerlink" href="#tagging" title="Permanent link">¶</a></h2>
|
|||
|
<p>Mailbox users can tag their mail address like in <code>me+facebook@example.org</code> and choose between to setups to handle this tag:</p>
|
|||
|
<p>1. Move this message to a subfolder "facebook" (will be created lower case if not existing)</p>
|
|||
|
<p>2. Prepend the tag to the subject: "[facebook] Subject"</p>
|
|||
|
<h2 id="two-factor-authentication">Two-factor authentication<a class="headerlink" href="#two-factor-authentication" title="Permanent link">¶</a></h2>
|
|||
|
<p>So far two methods for TFA are implemented. Both work with the fantastic <a href="https://www.yubico.com">Yubikey</a>.</p>
|
|||
|
<p>While Yubi OTP needs an active internet connection and an API ID and key, U2F will work with any FIDO U2F USB key out of the box, but can only be used when mailcow is accessed over HTTPS.</p>
|
|||
|
<p>Both methods support multiple YubiKeys.</p>
|
|||
|
<p>As administrator you are able to temporary disable a domain administrators TFA login until they successfully logged in.</p>
|
|||
|
<p>The key used to login will be displayed in green, while other keys remain grey.</p>
|
|||
|
<h3 id="yubi-otp">Yubi OTP<a class="headerlink" href="#yubi-otp" title="Permanent link">¶</a></h3>
|
|||
|
<p>The Yubi API ID and Key will be checked against the Yubico Cloud API. When setting up TFA you will be asked for your personal API account for this key.
|
|||
|
The API ID, API key and the first 12 characters (your YubiKeys ID in modhex) are stored in the MySQL table as secret.</p>
|
|||
|
<h3 id="u2f">U2F<a class="headerlink" href="#u2f" title="Permanent link">¶</a></h3>
|
|||
|
<p>Only Google Chrome (+derivates) and Opera support U2F authentication to this day natively.
|
|||
|
For Firefox you will need to install the "U2F Support Add-on" as provided on <a href="https://addons.mozilla.org/en-US/firefox/addon/u2f-support-add-on/">mozilla.org</a>.</p>
|
|||
|
<p>U2F works without an internet connection.</p>
|
|||
|
<h2 id="portainer">Portainer<a class="headerlink" href="#portainer" title="Permanent link">¶</a></h2>
|
|||
|
<p>In order to enable Portainer, the docker-compose.yml and site.conf for nginx must be modified.</p>
|
|||
|
<p>1. docker-compose.yml: Insert this block for portainer</p>
|
|||
|
<div class="codehilite"><pre><span></span> portainer-mailcow:
|
|||
|
image: portainer/portainer
|
|||
|
volumes:
|
|||
|
- /var/run/docker.sock:/var/run/docker.sock
|
|||
|
restart: always
|
|||
|
dns:
|
|||
|
- 172.22.1.254
|
|||
|
dns_search: mailcow-network
|
|||
|
networks:
|
|||
|
mailcow-network:
|
|||
|
aliases:
|
|||
|
- portainer
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<p>2a. data/conf/nginx/site.conf: Just beneath the opening line, at the same level as a server { block, add this:</p>
|
|||
|
<div class="codehilite"><pre><span></span><span class="nt">upstream</span> <span class="nt">portainer</span> <span class="p">{</span>
|
|||
|
<span class="err">server</span> <span class="n">portainer-mailcow</span><span class="p">:</span><span class="mi">9000</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">map</span> <span class="o">$</span><span class="nt">http_upgrade</span> <span class="o">$</span><span class="nt">connection_upgrade</span> <span class="p">{</span>
|
|||
|
<span class="err">default</span> <span class="err">upgrade</span><span class="p">;</span>
|
|||
|
<span class="err">''</span> <span class="err">close</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<p>2b. data/conf/nginx/site.conf: Then, inside <strong>both</strong> (ssl and plain) server blocks, add this:</p>
|
|||
|
<div class="codehilite"><pre><span></span> <span class="nt">location</span> <span class="o">/</span><span class="nt">portainer</span><span class="o">/</span> <span class="p">{</span>
|
|||
|
<span class="err">proxy_http_version</span> <span class="err">1.1</span><span class="p">;</span>
|
|||
|
<span class="err">proxy_set_header</span> <span class="err">Host</span> <span class="err">$http_host</span><span class="p">;</span> <span class="err">#</span> <span class="err">required</span> <span class="err">for</span> <span class="err">docker</span> <span class="err">client's</span> <span class="err">sake</span>
|
|||
|
<span class="err">proxy_set_header</span> <span class="err">X-Real-IP</span> <span class="err">$remote_addr</span><span class="p">;</span> <span class="err">#</span> <span class="err">pass</span> <span class="err">on</span> <span class="err">real</span> <span class="err">client's</span> <span class="err">IP</span>
|
|||
|
<span class="err">proxy_set_header</span> <span class="err">X-Forwarded-For</span> <span class="err">$proxy_add_x_forwarded_for</span><span class="p">;</span>
|
|||
|
<span class="err">proxy_set_header</span> <span class="err">X-Forwarded-Proto</span> <span class="err">$scheme</span><span class="p">;</span>
|
|||
|
<span class="err">proxy_read_timeout</span> <span class="err">900</span><span class="p">;</span>
|
|||
|
|
|||
|
<span class="err">proxy_set_header</span> <span class="err">Connection</span> <span class="err">""</span><span class="p">;</span>
|
|||
|
<span class="err">proxy_buffers</span> <span class="err">32</span> <span class="err">4k</span><span class="p">;</span>
|
|||
|
<span class="err">proxy_pass</span> <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">portainer</span><span class="o">/</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">location</span> <span class="o">/</span><span class="nt">portainer</span><span class="o">/</span><span class="nt">api</span><span class="o">/</span><span class="nt">websocket</span><span class="o">/</span> <span class="p">{</span>
|
|||
|
<span class="err">proxy_http_version</span> <span class="err">1.1</span><span class="p">;</span>
|
|||
|
<span class="err">proxy_set_header</span> <span class="err">Upgrade</span> <span class="err">$http_upgrade</span><span class="p">;</span>
|
|||
|
<span class="err">proxy_set_header</span> <span class="err">Connection</span> <span class="err">$connection_upgrade</span><span class="p">;</span>
|
|||
|
<span class="err">proxy_pass</span> <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">portainer</span><span class="o">/</span><span class="n">api</span><span class="o">/</span><span class="n">websocket</span><span class="o">/</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
</pre></div>
|
|||
|
|
|||
|
|
|||
|
<p>Now you can simply navigate to https://${MAILCOW_HOSTNAME}/portainer/ to view your Portainer container monitoring page. Youâll then be prompted to specify a new password for the <strong>admin</strong> account. After specifying your password, youâll then be able to connect to the Portainer UI.</p>
|
|||
|
<h2 id="change-autodiscover-setup-type">Change autodiscover setup type<a class="headerlink" href="#change-autodiscover-setup-type" title="Permanent link">¶</a></h2>
|
|||
|
<p>This disables ActiveSync in the autodiscover service for Outlook and configures it with IMAP and SMTP instead:</p>
|
|||
|
<p>Open <code>data/web/autodiscover.php</code> and set <code>'useEASforOutlook' => 'yes'</code> to <code>'useEASforOutlook' => 'no'</code>.</p>
|
|||
|
<p>To always use IMAP and SMTP instead of EAS, set <code>'autodiscoverType' => 'imap'</code>.</p>
|
|||
|
<h2 id="why-bind">Why Bind?<a class="headerlink" href="#why-bind" title="Permanent link">¶</a></h2>
|
|||
|
<p>For DNS blacklist lookups and DNSSEC.</p>
|
|||
|
<p>Most systems use either a public or a local caching DNS resolver.
|
|||
|
That's a very bad idea when it comes to filter spam using DNS-based blackhole lists (DNSBL) or similar technics.
|
|||
|
Most if not all providers apply a rate limit based on the DNS resolver that is used to query their service.
|
|||
|
Using a public resolver like Googles 4x8, OpenDNS or any other shared DNS resolver like your ISPs will hit that limit very soon.</p>
|
|||
|
|
|||
|
|
|||
|
</article>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</main>
|
|||
|
|
|||
|
|
|||
|
<footer class="md-footer">
|
|||
|
|
|||
|
<div class="md-footer-nav">
|
|||
|
<nav class="md-footer-nav__inner md-grid">
|
|||
|
|
|||
|
<a href="../first_steps/" title="First Steps" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
|
|||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
|||
|
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
|
|||
|
</div>
|
|||
|
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
|||
|
<span class="md-flex__ellipsis">
|
|||
|
<span class="md-footer-nav__direction">
|
|||
|
Previous
|
|||
|
</span>
|
|||
|
First Steps
|
|||
|
</span>
|
|||
|
</div>
|
|||
|
</a>
|
|||
|
|
|||
|
|
|||
|
</nav>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="md-footer-meta md-typeset">
|
|||
|
<div class="md-footer-meta__inner md-grid">
|
|||
|
<div class="md-footer-copyright">
|
|||
|
|
|||
|
powered by
|
|||
|
<a href="http://www.mkdocs.org" title="MkDocs">MkDocs</a>
|
|||
|
and
|
|||
|
<a href="http://squidfunk.github.io/mkdocs-material/" title="Material for MkDocs">
|
|||
|
Material for MkDocs</a>
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
<div class="md-footer-social">
|
|||
|
|
|||
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
|||
|
|
|||
|
<a href="https://github.com/mailcow/mailcow-dockerized" class="md-footer-social__link fa fa-github"></a>
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</footer>
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
<script src="../assets/javascripts/application-30ac6a1727.js"></script>
|
|||
|
<script>app.initialize({url:{base:".."}})</script>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</body>
|
|||
|
</html>
|