mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-06-24 09:49:12 +02:00
completely refactor README & parts of docs (#3097)
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
This commit is contained in:
parent
bee9e3627d
commit
853301338c
6 changed files with 551 additions and 543 deletions
|
@ -2,9 +2,94 @@
|
|||
title: 'Tutorials | Basic Installation'
|
||||
---
|
||||
|
||||
## Setting up a Simple Mail-Server
|
||||
## A Basic Example With Relevant Environmental Variables
|
||||
|
||||
This is a community contributed guide. Please let us know via a Github Issue if you're having any difficulty following the guide so that we can update it.
|
||||
This example provides you only with a basic example of what a minimal setup could look like. We **strongly recommend** that you go through the configuration file yourself and adjust everything to your needs. The default [docker-compose.yml](https://github.com/docker-mailserver/docker-mailserver/blob/master/docker-compose.yml) can be used for the purpose out-of-the-box, see the [_Usage_ chapter](../../usage.md).
|
||||
|
||||
``` YAML
|
||||
services:
|
||||
mailserver:
|
||||
image: docker.io/mailserver/docker-mailserver:latest
|
||||
container_name: mailserver
|
||||
# Provide the FQDN of your mail server here (Your DNS MX record should point to this value)
|
||||
hostname: mail.example.com
|
||||
ports:
|
||||
- "25:25"
|
||||
- "587:587"
|
||||
- "993:993"
|
||||
volumes:
|
||||
- ./docker-data/dms/mail-data/:/var/mail/
|
||||
- ./docker-data/dms/mail-state/:/var/mail-state/
|
||||
- ./docker-data/dms/mail-logs/:/var/log/mail/
|
||||
- ./docker-data/dms/config/:/tmp/docker-mailserver/
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
environment:
|
||||
- ENABLE_SPAMASSASSIN=1
|
||||
- SPAMASSASSIN_SPAM_TO_INBOX=1
|
||||
- ENABLE_CLAMAV=1
|
||||
- ENABLE_FAIL2BAN=1
|
||||
- ENABLE_POSTGREY=1
|
||||
cap_add:
|
||||
- NET_ADMIN # For Fail2Ban to work
|
||||
restart: always
|
||||
```
|
||||
|
||||
## A Basic LDAP Setup
|
||||
|
||||
**Note** There are currently no LDAP maintainers. If you encounter issues, please raise them in the issue tracker, but be aware that the core maintainers team will most likely not be able to help you. **We would appreciate and we encourage everyone to actively participate in maintaining LDAP-related code by becoming a maintainer!**
|
||||
|
||||
``` YAML
|
||||
services:
|
||||
mailserver:
|
||||
image: docker.io/mailserver/docker-mailserver:latest
|
||||
container_name: mailserver
|
||||
# Provide the FQDN of your mail server here (Your DNS MX record should point to this value)
|
||||
hostname: mail.example.com
|
||||
ports:
|
||||
- "25:25"
|
||||
- "587:587"
|
||||
- "993:993"
|
||||
volumes:
|
||||
- ./docker-data/dms/mail-data/:/var/mail/
|
||||
- ./docker-data/dms/mail-state/:/var/mail-state/
|
||||
- ./docker-data/dms/mail-logs/:/var/log/mail/
|
||||
- ./docker-data/dms/config/:/tmp/docker-mailserver/
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
environment:
|
||||
- ENABLE_SPAMASSASSIN=1
|
||||
- SPAMASSASSIN_SPAM_TO_INBOX=1
|
||||
- ENABLE_CLAMAV=1
|
||||
- ENABLE_FAIL2BAN=1
|
||||
- ENABLE_POSTGREY=1
|
||||
- ACCOUNT_PROVISIONER=LDAP
|
||||
- LDAP_SERVER_HOST=ldap # your ldap container/IP/ServerName
|
||||
- LDAP_SEARCH_BASE=ou=people,dc=localhost,dc=localdomain
|
||||
- LDAP_BIND_DN=cn=admin,dc=localhost,dc=localdomain
|
||||
- LDAP_BIND_PW=admin
|
||||
- LDAP_QUERY_FILTER_USER=(&(mail=%s)(mailEnabled=TRUE))
|
||||
- LDAP_QUERY_FILTER_GROUP=(&(mailGroupMember=%s)(mailEnabled=TRUE))
|
||||
- LDAP_QUERY_FILTER_ALIAS=(|(&(mailAlias=%s)(objectClass=PostfixBookMailForward))(&(mailAlias=%s)(objectClass=PostfixBookMailAccount)(mailEnabled=TRUE)))
|
||||
- LDAP_QUERY_FILTER_DOMAIN=(|(&(mail=*@%s)(objectClass=PostfixBookMailAccount)(mailEnabled=TRUE))(&(mailGroupMember=*@%s)(objectClass=PostfixBookMailAccount)(mailEnabled=TRUE))(&(mailalias=*@%s)(objectClass=PostfixBookMailForward)))
|
||||
- DOVECOT_PASS_FILTER=(&(objectClass=PostfixBookMailAccount)(uniqueIdentifier=%n))
|
||||
- DOVECOT_USER_FILTER=(&(objectClass=PostfixBookMailAccount)(uniqueIdentifier=%n))
|
||||
- ENABLE_SASLAUTHD=1
|
||||
- SASLAUTHD_MECHANISMS=ldap
|
||||
- SASLAUTHD_LDAP_SERVER=ldap
|
||||
- SASLAUTHD_LDAP_BIND_DN=cn=admin,dc=localhost,dc=localdomain
|
||||
- SASLAUTHD_LDAP_PASSWORD=admin
|
||||
- SASLAUTHD_LDAP_SEARCH_BASE=ou=people,dc=localhost,dc=localdomain
|
||||
- SASLAUTHD_LDAP_FILTER=(&(objectClass=PostfixBookMailAccount)(uniqueIdentifier=%U))
|
||||
- POSTMASTER_ADDRESS=postmaster@localhost.localdomain
|
||||
cap_add:
|
||||
- NET_ADMIN # For Fail2Ban to work
|
||||
restart: always
|
||||
```
|
||||
|
||||
## A Detailed Example
|
||||
|
||||
!!! note
|
||||
|
||||
This is a community contributed guide. Please let us know via a Github Issue if you're having any difficulty following the guide so that we can update it.
|
||||
|
||||
This guide is focused on only using [SMTP ports (not POP3 and IMAP)][docs-ports] with the intent to send received mail to another MTA service such as _Gmail_. It is not intended to have a MUA client (_eg: Thunderbird_) to retrieve mail directly from `docker-mailserver` via POP3/IMAP.
|
||||
|
||||
|
@ -23,15 +108,12 @@ In this setup `docker-mailserver` is not intended to receive email externally, s
|
|||
!!! example
|
||||
|
||||
```yaml
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
mailserver:
|
||||
image: docker.io/mailserver/docker-mailserver:latest
|
||||
container_name: mailserver
|
||||
hostname: mail
|
||||
# Change this to your domain, it is used for your email accounts (eg: user@example.com):
|
||||
domainname: example.com
|
||||
# Provide the FQDN of your mail server here (Your DNS MX record should point to this value)
|
||||
hostname: mail.example.com
|
||||
ports:
|
||||
- "25:25"
|
||||
- "587:587"
|
||||
|
@ -41,8 +123,6 @@ In this setup `docker-mailserver` is not intended to receive email externally, s
|
|||
- ./docker-data/dms/mail-state/:/var/mail-state/
|
||||
- ./docker-data/dms/mail-logs/:/var/log/mail/
|
||||
- ./docker-data/dms/config/:/tmp/docker-mailserver/
|
||||
# The "from" path will vary based on where your certs are locally:
|
||||
- ./docker-data/nginx-proxy/certs/:/etc/letsencrypt/
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
environment:
|
||||
- ENABLE_FAIL2BAN=1
|
||||
|
@ -51,16 +131,12 @@ In this setup `docker-mailserver` is not intended to receive email externally, s
|
|||
# Allow sending emails from other docker containers
|
||||
# Beware creating an Open Relay: https://docker-mailserver.github.io/docker-mailserver/edge/config/environment/#permit_docker
|
||||
- PERMIT_DOCKER=network
|
||||
# All env below are default settings:
|
||||
- ONE_DIR=1
|
||||
- ENABLE_POSTGREY=0
|
||||
- ENABLE_CLAMAV=0
|
||||
- ENABLE_SPAMASSASSIN=0
|
||||
# You may want to enable this: https://docker-mailserver.github.io/docker-mailserver/edge/config/environment/#spoof_protection
|
||||
# See step 8 below, which demonstrates setup with enabled/disabled SPOOF_PROTECTION:
|
||||
- SPOOF_PROTECTION=0
|
||||
cap_add:
|
||||
- NET_ADMIN # For Fail2Ban to work
|
||||
restart: always
|
||||
```
|
||||
|
||||
- The docs have a detailed page on [Environment Variables][docs-environment] for reference.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue