Home

Awesome

mailcow: dockerized - Ansible role 🐮 + 🐋 = 💕

This role will setup a mailcow dockerized email server.

Prerequisites

Requirements

RequirementsDescription
docker ceDocker has to be installed on the host
docker-composedocker-compose is needed

Notes

This role will use by default the inventory_hostname as mailcow hostname, this means that you have to use the full qualified domain name as your inventory hostname e.g. mail.mailcow.tld or you set mailcow__hostname to the correct FQDN.

Variables

namepurposedefault valuenote
mailcow__hostname sets MAILCOW_HOSTNAMEinventory_hostnameneeds to be an full qualified domain name
mailcow__install_pathsets the path where the mailcow-dockerized repo will be cloned/opt/mailcow-dockerized
mailcow__git_versioncheckout a specific version of mailcowmaster
mailcow__timezoneused to set the timezone your mailcow runs in during the config generationnot setmust be set
mailcow__docker_compose_project_namesets the docker-compose projectname to a user-defined stringmailcowdockerized
mailcow__themeset the default mailcow theme in vars.local.inc.phplumen
mailcow__config_http_portsets HTTP_PORT in mailcow.conf80
mailcow__config_http_bindsets HTTP_BIND in mailcow.confnone
mailcow__config_https_portsets HTTPS_PORT in mailcow.conf443
mailcow__config_https_bindsets HTTPS_BIND in mailcow.confnone
mailcow__config_acl_anyonesets ACL_ANYONEdisallow
mailcow__config_maildir_gc_timesets MAILDIR_GC_TIME in mailcow.conf1440
mailcow__config_additional_sansets ADDITIONAL_SAN in mailcow.confneeds to be a list
mailcow__config_additional_server_namessets ADDITIONAL_SERVER_NAMES in mailcow.confneeds to be a list
mailcow__config_skip_lets_encryptsets SKIP_LETS_ENCRYPT in mailcow.conf
mailcow__config_enable_ssl_snisets ENABLE_SSL_SNI in mailcow.conf
mailcow__config_skip_ip_checksets SKIP_IP_CHECK in mailcow.conf
mailcow__config_skip_http_verificationsets SKIP_HTTP_VERIFICATION in mailcow.confn
mailcow__config_skip_clamdsets SKIP_CLAMD in mailcow.confn
mailcow__config_skip_solrsets SKIP_SOLR in mailcow.confn
mailcow__config_solr_heapsets SOLR_HEAP in mailcow.conf1024
mailcow__config_skip_sogosets SKIP_SOGO in mailcow.confn
mailcow__config_allow_admin_email_loginsets ALLOW_ADMIN_EMAIL_LOGIN in mailcow.confn
mailcow__config_use_watchdogsets USE_WATCHDOG in mailcow.confn
mailcow__config_watchdog_notify_emailsets WATCHDOG_NOTIFY_EMAIL in mailcow.conf
mailcow__config_watchdog_notify_bansets WATCHDOG_NOTIFY_BAN in mailcow.confy
mailcow__config_watchdog_subjectsets WATCHDOG_SUBJECT in mailcow.confWatchdog ALERT
mailcow__config_log_linessets LOG_LINES in mailcow.conf9999
mailcow__config_sogo_expire_sessionsets SOGO_EXPIRE_SESSION in mailcow.conf480
mailcow__install_updatesif yes the mailcow ansible role will also update an existing installationyes
mailcow__redirect_http_to_httpsif yes, all requests via HTTP will be redirected to HTTPSnoalso see https://mailcow.github.io/mailcow-dockerized-docs/u_e-80_to_443/
mailcow__config_acme_contactsets ACME_CONTACT in mailcow.conf
mailcow__rspamd_clamd_serversconfigures the clamd server used by rspamdclamd:3310
mailcow__compose_commandconfigures the command that is used for composedocker composeset to docker-compose for the standalone version of compose

Usage

Minimal playbook:

---

- name: Install Python3
  hosts: all
  become: true
  gather_facts: false
  roles:
    - { role: raw,0.0, vars: {command: 'apt-get install -y python3 python3-pip'} }

- name: Main Playbook
  hosts: all
  become: true
  gather_facts: true
  vars:
    mailcow__timezone: Europe/Berlin
  roles:
    - Ansible-Roles.docker-ce
    - Ansible-Roles.docker-compose
    - Ansible-Roles.mailcow