2014-08-20 02:33:16 +02:00
|
|
|
postfix:
|
2015-03-25 12:49:57 +01:00
|
|
|
manage_master_config: True
|
2015-07-11 11:58:18 +02:00
|
|
|
master_config:
|
2017-12-08 14:04:35 +01:00
|
|
|
enable_dovecot: False
|
|
|
|
# The following are the default values:
|
|
|
|
dovecot:
|
|
|
|
user: vmail
|
|
|
|
group: vmail
|
|
|
|
flags: DRhu
|
|
|
|
argv: "/usr/lib/dovecot/deliver -d ${recipient}"
|
|
|
|
|
2015-07-11 11:58:18 +02:00
|
|
|
enable_submission: False
|
2017-12-08 13:20:01 +01:00
|
|
|
# To replace the defaults use this:
|
|
|
|
submission:
|
|
|
|
smtpd_tls_security_level: encrypt
|
|
|
|
smtpd_sasl_auth_enable: yes
|
|
|
|
smtpd_client_restrictions: permit_sasl_authenticated,reject
|
2015-07-11 11:58:18 +02:00
|
|
|
|
2018-03-11 19:22:12 +01:00
|
|
|
# Alternative way of managing services allowing for much more finegrained
|
|
|
|
# control over each service. See postfix/services.jinja for details.
|
|
|
|
services:
|
|
|
|
smtp:
|
|
|
|
# Limit to no more than 10 smtp processes
|
|
|
|
maxproc: 10
|
|
|
|
# Enable oldstyle TLS wrapped SMTP
|
|
|
|
smtps:
|
|
|
|
enable: True
|
|
|
|
submission:
|
|
|
|
enable: True
|
|
|
|
args:
|
|
|
|
- "-o smtpd_tls_security_level=encrypt"
|
|
|
|
- "-o smtpd_sasl_auth_enable=yes"
|
|
|
|
- "-o smtpd_client_restrictions: permit_sasl_authenticated,reject"
|
|
|
|
tlsproxy:
|
|
|
|
enable: True
|
|
|
|
chroot: True
|
|
|
|
|
2016-05-18 19:29:37 +02:00
|
|
|
enable_service: True
|
|
|
|
|
2015-08-22 13:26:26 +02:00
|
|
|
postgrey:
|
|
|
|
enabled: True
|
2016-05-19 13:55:15 +02:00
|
|
|
enable_service: True
|
2015-08-22 13:26:26 +02:00
|
|
|
location: inet:172.16.0.5:6379
|
|
|
|
|
2015-08-22 13:59:29 +02:00
|
|
|
policyd-spf:
|
|
|
|
enabled: True
|
|
|
|
time_limit: 7200s
|
|
|
|
|
2015-03-25 12:49:57 +01:00
|
|
|
config:
|
|
|
|
smtpd_banner: $myhostname ESMTP $mail_name
|
2016-03-14 22:43:30 +01:00
|
|
|
smtp_tls_CApath: /etc/ssl/certs
|
2015-03-25 12:49:57 +01:00
|
|
|
biff: 'no'
|
|
|
|
append_dot_mydomain: 'no'
|
|
|
|
readme_directory: 'no'
|
|
|
|
myhostname: localhost
|
|
|
|
mydestination: localhost, localhost.localdomain
|
|
|
|
relayhost:
|
|
|
|
mynetworks: 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
|
|
|
|
mailbox_size_limit: 0
|
|
|
|
recipient_delimiter: +
|
|
|
|
inet_interfaces: all
|
2015-08-31 22:34:51 +02:00
|
|
|
|
2017-01-08 20:02:57 +01:00
|
|
|
#postsrsd:
|
|
|
|
sender_canonical_maps: tcp:127.0.0.1:10001
|
|
|
|
sender_canonical_classes: envelope_sender
|
|
|
|
recipient_canonical_maps: tcp:127.0.0.1:10002
|
|
|
|
recipient_canonical_classes: envelope_recipient
|
|
|
|
|
2015-06-20 22:49:09 +02:00
|
|
|
# Alias
|
|
|
|
alias_maps: hash:/etc/aliases
|
2017-08-24 13:35:24 +02:00
|
|
|
# This is the list of files for the newaliases
|
|
|
|
# cmd to process (see postconf(5) for details).
|
|
|
|
# Only local hash/btree/dbm files:
|
2015-06-20 22:49:09 +02:00
|
|
|
alias_database: hash:/etc/aliases
|
|
|
|
|
2015-06-21 01:18:55 +02:00
|
|
|
# Virtual users
|
|
|
|
virtual_alias_maps: proxy:mysql:/etc/postfix/virtual_alias_maps.cf
|
|
|
|
virtual_mailbox_domains: proxy:mysql:/etc/postfix/virtual_mailbox_domains.cf
|
|
|
|
virtual_mailbox_maps: proxy:mysql:/etc/postfix/virtual_mailbox_maps.cf
|
|
|
|
virtual_mailbox_base: /home/vmail
|
|
|
|
virtual_mailbox_limit: 512000000
|
|
|
|
virtual_minimum_uid: 5000
|
|
|
|
virtual_transport: virtual
|
|
|
|
virtual_uid_maps: static:5000
|
|
|
|
virtual_gid_maps: static:5000
|
|
|
|
|
|
|
|
local_transport: virtual
|
|
|
|
local_recipient_maps: $virtual_mailbox_maps
|
|
|
|
transport_maps: hash:/etc/postfix/transport
|
|
|
|
|
2015-06-20 22:49:09 +02:00
|
|
|
# SMTP server
|
|
|
|
smtpd_tls_session_cache_database: btree:${data_directory}/smtpd_scache
|
|
|
|
smtpd_use_tls: 'yes'
|
2015-06-21 01:18:55 +02:00
|
|
|
smtpd_sasl_auth_enable: 'yes'
|
|
|
|
smtpd_sasl_type: dovecot
|
|
|
|
smtpd_sasl_path: /var/run/dovecot/auth-client
|
|
|
|
smtpd_recipient_restrictions: permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
|
|
|
|
smtpd_relay_restrictions: permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
|
|
|
|
smtpd_sasl_security_options: noanonymous
|
|
|
|
smtpd_sasl_tls_security_options: $smtpd_sasl_security_options
|
|
|
|
smtpd_tls_auth_only: 'yes'
|
|
|
|
smtpd_sasl_local_domain: $mydomain
|
|
|
|
smtpd_tls_loglevel: 1
|
|
|
|
smtpd_tls_session_cache_timeout: 3600s
|
|
|
|
|
|
|
|
relay_domains: '$mydestination'
|
2015-06-20 22:49:09 +02:00
|
|
|
|
|
|
|
# SMTP server certificate and key (from pillar data)
|
2015-08-30 19:30:08 +02:00
|
|
|
smtpd_tls_cert_file: /etc/postfix/ssl/server-cert.crt
|
|
|
|
smtpd_tls_key_file: /etc/postfix/ssl/server-cert.key
|
2015-06-20 22:49:09 +02:00
|
|
|
|
|
|
|
# SMTP client
|
|
|
|
smtp_tls_session_cache_database: btree:${data_directory}/smtp_scache
|
|
|
|
smtp_use_tls: 'yes'
|
2015-08-30 19:30:08 +02:00
|
|
|
smtp_tls_cert_file: /etc/postfix/ssl/example.com-relay-client-cert.crt
|
|
|
|
smtp_tls_key_file: /etc/postfix/ssl/example.com-relay-client-cert.key
|
2015-06-20 22:49:09 +02:00
|
|
|
|
2016-04-08 17:50:52 +02:00
|
|
|
smtp_sasl_password_maps: hash:/etc/postfix/sasl_passwd
|
|
|
|
sender_canonical_maps: hash:/etc/postfix/sender_canonical
|
|
|
|
relay_recipient_maps: hash:/etc/postfix/relay_domains
|
|
|
|
virtual_alias_maps: hash:/etc/postfix/virtual
|
|
|
|
|
2015-06-21 01:18:55 +02:00
|
|
|
transport:
|
|
|
|
DOMAIN_NAME: ':[IP_ADDRESS]'
|
|
|
|
|
|
|
|
vmail:
|
|
|
|
user: postfix_user
|
|
|
|
password: DB_PASSWD
|
|
|
|
hosts: DB_HOST
|
|
|
|
dbname: postfix_db
|
|
|
|
|
2018-03-08 10:40:09 +01:00
|
|
|
# add mysql query to virtual
|
2017-04-12 17:06:16 +02:00
|
|
|
mysql:
|
|
|
|
virtual_mailbox_domains:
|
|
|
|
table: virtual_domains
|
|
|
|
select_field: 1
|
|
|
|
where_field: name
|
|
|
|
virtual_alias_maps:
|
|
|
|
table: virtual_aliases
|
|
|
|
select_field: destination
|
|
|
|
where_field: email
|
|
|
|
virtual_mailbox_maps:
|
|
|
|
table: virtual_users
|
|
|
|
select_field: 1
|
|
|
|
where_field: email
|
|
|
|
|
2017-05-08 16:43:47 +02:00
|
|
|
aliases:
|
|
|
|
# manage single aliases
|
|
|
|
# this uses the aliases file defined in the minion config, /etc/aliases by default
|
|
|
|
use_file: false
|
|
|
|
present:
|
|
|
|
root: info@example.com
|
|
|
|
absent:
|
|
|
|
- root
|
|
|
|
|
|
|
|
# manage entire aliases file
|
|
|
|
use_file: true
|
|
|
|
content: |
|
|
|
|
# Forward all local *nix users mail to our admins (via greedy regexp)
|
|
|
|
/.+/ admins@example.com
|
|
|
|
|
2015-08-30 19:30:08 +02:00
|
|
|
certificates:
|
|
|
|
server-cert:
|
|
|
|
public_cert: |
|
2015-06-20 22:49:09 +02:00
|
|
|
-----BEGIN CERTIFICATE-----
|
2015-08-30 19:30:08 +02:00
|
|
|
(Your primary SSL certificate: smtp.example.com.crt)
|
2015-06-20 22:49:09 +02:00
|
|
|
-----END CERTIFICATE-----
|
|
|
|
-----BEGIN CERTIFICATE-----
|
2015-08-30 19:30:08 +02:00
|
|
|
(Your intermediate certificate: example-ca.crt)
|
2015-06-20 22:49:09 +02:00
|
|
|
-----END CERTIFICATE-----
|
2015-08-30 19:30:08 +02:00
|
|
|
-----BEGIN CERTIFICATE-----
|
|
|
|
(Your root certificate: trusted-root.crt)
|
|
|
|
-----END CERTIFICATE-----
|
|
|
|
private_key: |
|
2015-06-20 22:49:09 +02:00
|
|
|
-----BEGIN RSA PRIVATE KEY-----
|
2015-08-30 19:30:08 +02:00
|
|
|
(Your Private key)
|
2015-06-20 22:49:09 +02:00
|
|
|
-----END RSA PRIVATE KEY-----
|
|
|
|
|
2015-08-30 19:30:08 +02:00
|
|
|
example.com-relay-client-cert:
|
|
|
|
public_cert: |
|
|
|
|
-----BEGIN CERTIFICATE-----
|
|
|
|
(Your primary SSL certificate: smtp.example.com.crt)
|
|
|
|
-----END CERTIFICATE-----
|
|
|
|
private_key: |
|
2015-06-20 22:49:09 +02:00
|
|
|
-----BEGIN RSA PRIVATE KEY-----
|
2015-08-30 19:30:08 +02:00
|
|
|
(Your Private key)
|
2015-06-20 22:49:09 +02:00
|
|
|
-----END RSA PRIVATE KEY-----
|
2016-04-08 17:50:52 +02:00
|
|
|
|
|
|
|
mapping:
|
|
|
|
smtp_sasl_password_maps:
|
|
|
|
- smtp.example.com: myaccount:somepassword
|
|
|
|
|
|
|
|
sender_canonical_maps:
|
|
|
|
- root: servers@example.com
|
|
|
|
- nagios: alerts@example.com
|
|
|
|
|
|
|
|
relay_recipient_maps:
|
|
|
|
- example.com: OK
|
|
|
|
|
|
|
|
virtual_alias_maps:
|
|
|
|
- groupaliasexample:
|
|
|
|
- someuser_1@example.com
|
|
|
|
- someuser_2@example.com
|
|
|
|
- singlealiasexample: someuser_3@example.com
|