|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | +# vim: ft=yaml |
| 3 | +--- |
| 4 | +postfix: |
| 5 | + manage_master_config: true |
| 6 | + master_config: |
| 7 | + # Preferred way of managing services/processes. This allows for finegrained |
| 8 | + # control over each service. See postfix/services.yaml for defaults that can |
| 9 | + # be overridden. |
| 10 | + services: |
| 11 | + smtp: |
| 12 | + # Limit to no more than 10 smtp processes |
| 13 | + maxproc: 10 |
| 14 | + # Disable oldstyle TLS wrapped SMTP |
| 15 | + smtps: |
| 16 | + enable: false |
| 17 | + # Enable submission service on port 587/tcp with custom options |
| 18 | + submission: |
| 19 | + enable: true |
| 20 | + args: |
| 21 | + - "-o smtpd_tls_security_level=encrypt" |
| 22 | + - "-o smtpd_sasl_auth_enable=yes" |
| 23 | + - "-o smtpd_client_restrictions=permit_sasl_authenticated,reject" |
| 24 | + tlsproxy: |
| 25 | + enable: true |
| 26 | + chroot: true |
| 27 | + |
| 28 | + # Backwards compatible definition of dovecot delivery in master.cf |
| 29 | + enable_dovecot: false |
| 30 | + # Backwards compatible definition of submission listener in master.cf |
| 31 | + enable_submission: false |
| 32 | + |
| 33 | + enable_service: true |
| 34 | + reload_service: true |
| 35 | + |
| 36 | + config: |
| 37 | + smtpd_banner: $myhostname ESMTP $mail_name |
| 38 | + smtp_tls_CApath: /etc/ssl/certs |
| 39 | + biff: 'no' |
| 40 | + append_dot_mydomain: 'no' |
| 41 | + readme_directory: 'no' |
| 42 | + myhostname: localhost |
| 43 | + mydestination: localhost, localhost.localdomain |
| 44 | + relayhost: '' |
| 45 | + mynetworks: 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 |
| 46 | + mailbox_size_limit: 0 |
| 47 | + recipient_delimiter: + |
| 48 | + # using all has problems in centos with ipv6 |
| 49 | + inet_interfaces: 127.0.0.1 |
| 50 | + inet_protocols: all |
| 51 | + |
| 52 | + # Alias |
| 53 | + alias_maps: hash:/etc/aliases |
| 54 | + # This is the list of files for the newaliases |
| 55 | + # cmd to process (see postconf(5) for details). |
| 56 | + # Only local hash/btree/dbm files: |
| 57 | + alias_database: hash:/etc/aliases |
| 58 | + |
| 59 | + local_transport: virtual |
| 60 | + local_recipient_maps: $virtual_mailbox_maps |
| 61 | + transport_maps: hash:/etc/postfix/transport |
| 62 | + |
| 63 | + # SMTP server |
| 64 | + smtpd_tls_session_cache_database: btree:${data_directory}/smtpd_scache |
| 65 | + smtpd_use_tls: 'yes' |
| 66 | + smtpd_sasl_auth_enable: 'yes' |
| 67 | + smtpd_sasl_type: dovecot |
| 68 | + smtpd_sasl_path: /var/run/dovecot/auth-client |
| 69 | + smtpd_recipient_restrictions: >- |
| 70 | + permit_mynetworks, |
| 71 | + permit_sasl_authenticated, |
| 72 | + reject_unauth_destination |
| 73 | + smtpd_relay_restrictions: >- |
| 74 | + permit_mynetworks, |
| 75 | + permit_sasl_authenticated, |
| 76 | + reject_unauth_destination |
| 77 | + smtpd_sasl_security_options: noanonymous |
| 78 | + smtpd_sasl_tls_security_options: $smtpd_sasl_security_options |
| 79 | + smtpd_tls_auth_only: 'yes' |
| 80 | + smtpd_sasl_local_domain: $mydomain |
| 81 | + smtpd_tls_loglevel: 1 |
| 82 | + smtpd_tls_session_cache_timeout: 3600s |
| 83 | + |
| 84 | + relay_domains: '$mydestination' |
| 85 | + |
| 86 | + # SMTP server certificate and key (from pillar data) |
| 87 | + smtpd_tls_cert_file: /etc/postfix/ssl/server-cert.crt |
| 88 | + smtpd_tls_key_file: /etc/postfix/ssl/server-cert.key |
| 89 | + |
| 90 | + # SMTP client |
| 91 | + smtp_tls_session_cache_database: btree:${data_directory}/smtp_scache |
| 92 | + smtp_use_tls: 'yes' |
| 93 | + smtp_tls_cert_file: /etc/postfix/ssl/example.com-relay-client-cert.crt |
| 94 | + smtp_tls_key_file: /etc/postfix/ssl/example.com-relay-client-cert.key |
| 95 | + smtp_tls_policy_maps: hash:/etc/postfix/tls_policy |
| 96 | + |
| 97 | + smtp_sasl_password_maps: hash:/etc/postfix/sasl_passwd |
| 98 | + sender_canonical_maps: hash:/etc/postfix/sender_canonical |
| 99 | + relay_recipient_maps: hash:/etc/postfix/relay_domains |
| 100 | + virtual_alias_maps: hash:/etc/postfix/virtual |
| 101 | + |
| 102 | + aliases: |
| 103 | + # manage single aliases |
| 104 | + # this uses the aliases file defined in the minion config, /etc/aliases by default |
| 105 | + use_file: false |
| 106 | + present: |
| 107 | + root: info@example.com |
| 108 | + absent: |
| 109 | + - root |
| 110 | + |
| 111 | + certificates: |
| 112 | + server-cert: |
| 113 | + public_cert: | |
| 114 | + -----BEGIN CERTIFICATE----- |
| 115 | + (Your primary SSL certificate: smtp.example.com.crt) |
| 116 | + -----END CERTIFICATE----- |
| 117 | + -----BEGIN CERTIFICATE----- |
| 118 | + (Your intermediate certificate: example-ca.crt) |
| 119 | + -----END CERTIFICATE----- |
| 120 | + -----BEGIN CERTIFICATE----- |
| 121 | + (Your root certificate: trusted-root.crt) |
| 122 | + -----END CERTIFICATE----- |
| 123 | + private_key: | |
| 124 | + -----BEGIN RSA PRIVATE KEY----- |
| 125 | + (Your Private key) |
| 126 | + -----END RSA PRIVATE KEY----- |
| 127 | +
|
| 128 | + example.com-relay-client-cert: |
| 129 | + public_cert: | |
| 130 | + -----BEGIN CERTIFICATE----- |
| 131 | + (Your primary SSL certificate: smtp.example.com.crt) |
| 132 | + -----END CERTIFICATE----- |
| 133 | + private_key: | |
| 134 | + -----BEGIN RSA PRIVATE KEY----- |
| 135 | + (Your Private key) |
| 136 | + -----END RSA PRIVATE KEY----- |
| 137 | +
|
| 138 | + mapping: |
| 139 | + transport_maps: |
| 140 | + - example.com: '10.1.1.1' |
| 141 | + |
| 142 | + smtp_tls_policy_maps: |
| 143 | + - example.com: encrypt |
| 144 | + - .example.com: encrypt |
| 145 | + |
| 146 | + smtp_sasl_password_maps: |
| 147 | + - smtp.example.com: myaccount:somepassword |
| 148 | + |
| 149 | + sender_canonical_maps: |
| 150 | + - root: servers@example.com |
| 151 | + - nagios: alerts@example.com |
| 152 | + |
| 153 | + relay_recipient_maps: |
| 154 | + - example.com: OK |
| 155 | + |
| 156 | + virtual_alias_maps: |
| 157 | + - groupaliasexample: |
| 158 | + - someuser_1@example.com |
| 159 | + - someuser_2@example.com |
| 160 | + - singlealiasexample: someuser_3@example.com |
0 commit comments