postfix/README.md

121 lines
2.6 KiB
Markdown
Raw Normal View History

2021-11-18 13:44:30 +00:00
[Postfix](http://www.postfix.org/) with dovecot authentication and [rspamd](https://rspamd.com/) using postgres.
2016-10-28 11:05:33 +00:00
2022-01-22 18:58:58 +00:00
# Database
```
create table if not exists virtual_domains (
name text primary key
);
create table if not exists virtual_users (
email text primary key,
domain_name text not null references virtual_domains(name)
);
create table if not exists virtual_aliases (
domain_name text not null references virtual_domains(name),
source text not null,
destination text not null
);
2022-02-18 08:35:14 +00:00
2022-01-22 18:58:58 +00:00
```
2016-10-31 10:14:36 +00:00
# Volumes
2016-10-28 11:05:33 +00:00
- `/etc/ssl/mail:ro`: certificates have to be here.
2016-10-31 10:14:36 +00:00
# Environment Variables
## MYHOSTNAME
2016-10-28 11:05:33 +00:00
Fully qualified hostname.
2016-10-31 10:14:36 +00:00
## MYDOMAIN
2016-10-28 11:05:33 +00:00
The internet domain name of the mail system.
2016-10-31 10:14:36 +00:00
## SMTP_BANNER
2016-10-28 11:05:33 +00:00
Text prepended to `$myhostname ESMTP $mail_name` for the smtp banner.
2016-10-31 10:14:36 +00:00
## DOVECOT_HOST
2016-10-28 11:05:33 +00:00
Hostname for the dovecot host.
2016-10-31 10:14:36 +00:00
## DOVECOT_AUTH_PORT
2016-10-28 11:05:33 +00:00
Port for the dovecot host.
2016-10-31 10:14:36 +00:00
## LMTP_HOST
2016-10-28 11:05:33 +00:00
Hostname for the lmtp host (probably dovecot).
2016-10-31 10:14:36 +00:00
## LMTP_PORT
2016-10-28 11:05:33 +00:00
Port for the lmtp host.
2021-10-05 06:15:54 +00:00
## CERT_DOMAIN
Name of the certificate domain.
2016-10-28 11:05:33 +00:00
2021-10-05 06:15:54 +00:00
Name of the key file.
2016-10-28 11:05:33 +00:00
2021-10-05 06:15:54 +00:00
## DB_HOST
2016-10-28 11:05:33 +00:00
2021-10-05 06:15:54 +00:00
Postgre database host.
2016-10-28 11:05:33 +00:00
2021-10-05 06:15:54 +00:00
## DB_USER
- default: email
2016-10-28 11:05:33 +00:00
2021-10-05 06:15:54 +00:00
User to connect to the database.
2016-10-28 11:05:33 +00:00
2021-10-05 06:15:54 +00:00
## DB_PASSWORD
2016-10-28 11:05:33 +00:00
2021-10-05 06:15:54 +00:00
Password to use for the database user.
2016-10-28 11:05:33 +00:00
2021-10-05 06:15:54 +00:00
## DB_NAME
- default: email
2016-10-28 11:05:33 +00:00
2021-10-05 06:15:54 +00:00
Name of the postgre database to connect to.
2016-10-28 11:05:33 +00:00
2016-10-31 10:14:36 +00:00
## MESSAGE_SIZELIMIT
2016-10-28 11:05:33 +00:00
- default: 20000000
Message size limit in bytes.
2016-10-31 10:14:36 +00:00
## MAILBOX_SIZELIMIT
2016-10-28 11:05:33 +00:00
- default: 0
Mailbox size limit in bytes. `0` disables the limit.
2016-10-31 10:14:36 +00:00
## TLS_SECURITY_LEVEL
2019-02-18 13:48:56 +00:00
- default: may
2016-10-28 11:05:33 +00:00
One of:
2017-09-22 12:32:42 +00:00
- none: TLS will not be used.
- may: Opportunistic TLS: announce STARTTLS support to remote SMTP clients, but do not require that clients use TLS encryption.
- encrypt: Mandatory TLS encryption: announce STARTTLS support to remote SMTP clients, and require that clients use TLS encryption.
2016-10-28 11:05:33 +00:00
According to [RFC 2487](http://tools.ietf.org/html/rfc2487) this MUST NOT be applied in case of a publicly-referenced SMTP server.
2016-10-31 10:14:36 +00:00
## TLS_PROTOCOLS
2019-02-18 13:48:21 +00:00
- default: !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
2016-10-28 11:05:33 +00:00
Comma seperated list of accepted TLS protocols.
2016-10-31 10:14:36 +00:00
## TLS_CIPHERS
2016-10-28 11:05:33 +00:00
- default: high
The minimum TLS cipher grade that the Postfix SMTP server will use with opportunistic TLS encryption.
2016-10-31 10:14:36 +00:00
## TLS_EXCLUDE_CIPHERS
2016-10-28 11:05:33 +00:00
- default: aNULL, MD5, 3DES
Comma seperated list of ciphers or cipher types to exclude from the SMTP server cipher list at all TLS security levels.
2021-11-18 13:44:30 +00:00
## RSPAMD_ADDRESS
- default: inet:127.0.0.1:11332
2021-12-22 10:35:46 +00:00
Where to connect to rspamd.
2021-12-22 10:34:40 +00:00
## EXTERNAL_IP
The network interface addresses that this mail system receives mail on by way of a proxy or network address translation unit.
2016-10-31 10:14:36 +00:00
# Ports
2016-10-28 11:05:33 +00:00
- 25
- 587
2016-10-31 10:14:36 +00:00
# Capabilities
2016-10-28 11:05:33 +00:00
- DAC_OVERRIDE
- NET_BIND_SERVICE
- SETGID
- SETUID