-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cf
114 lines (86 loc) · 3.5 KB
/
main.cf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
myorigin = "container1"
smtpd_banner = $myhostname ESMTP $mail_name
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# Turn on debugging for localhost
debug_peer_list = 127.0.0.1
debug_peer_level = 2
# Use dovecot for SMTP authentication
smtpd_sasl_type = dovecot
#smtpd_sasl_path = private/auth
smtpd_sasl_path = inet:dovecot:9000
smtpd_sasl_auth_enable = yes
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
#smtpd_sender_login_maps=mysql:/etc/postfix/mysql/mysql-virtual-users.cf
smtpd_sender_login_maps=hash:/etc/postfix/mysql/mysql-virtual-smtp-sender-map
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# http://www.unixwiz.net/techtips/postfix-HELO.html
# @todo add in later
#smtpd_helo_restrictions =
# permit_mynetworks,
# reject_non_fqdn_helo_hostname,
# reject_invalid_helo_hostname,
# check_helo_access hash:$config_directory/helo_checks,
# permit
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
myhostname = dovecot
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
# handle this in dovecot deliver
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
## Handle Virtual Domains ##
virtual_mailbox_domains = mysql:/etc/postfix/mysql/mysql-virtual-domains.cf
## Handle Virtual Aliases ##
virtual_alias_maps = mysql:/etc/postfix/mysql/mysql-virtual-alias.cf
# @todo the same for virtual-alias-domains
## Handle Virtual Users ##
virtual_mailbox_maps = mysql:/etc/postfix/mysql/mysql-virtual-users.cf
# this only works with virtual but it's a good safty net
#virtual_mailbox_base = /var/mail/virtual_mailboxes/
virtual_mailbox_base = /
# using the mail user and mail group for postfix
# this is only used by virtual
#virtual_uid_maps = static:8001
#virtual_gid_maps = static:8001
# Use dovecot to handle delivery to the virtual domains
#virtual_transport = maildrop
#virtual_transport = dovecot
# Transport via LMTP to dovecot. We use LMTP so that postfix is responsible for queuing
virtual_transport = lmtp:dovecot:2525
## only deliver 1 recipient at a time , I think this is only for SpamAssassin##
# dovecot_destination_recipient_limit=1
#smtpd_milters = unix:/var/lib/rspamd/milter.sock
# or for TCP socket
smtpd_milters = inet:rspamd:11332
milter_protocol = 6
milter_mail_macros = i {mail_addr} {client_addr} {client_name} {auth_authen}
# skip mail without checks if something goes wrong
milter_default_action = accept
# smtp-amavis_destination_concurrency_limit = 20
inet_protocols = all
# not using amavis anymore
#content_filter = lmtp-amavis:[localhost]:10024
policy-spf_time_limit = 3600s
# @todo enable
#smtpd_recipient_restrictions = check_policy_service unix:private/policy-spf
compatibility_level = 2