Izuru Yakumo d993c43689 Giving this a second and final chance
Signed-off-by: Izuru Yakumo <eternal-servant@yakumo.dev>
2025-04-11 19:29:21 -03:00

72 lines
2.2 KiB
CFEngine3

# $YakumoLabs$
compatibility_level=3.6
smtpd_banner = $myhostname ESMTP
mail_name = @@MAIL_NAME@@
inet_interfaces = all
inet_protocols = all
myorigin = @@DOMAIN@@
myhostname = $myorigin
mydomain = $myorigin
mydestination = $myorigin
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
local_transport = local
alias_maps = hash:@@SYSCONFDIR@@/postfix/aliases
alias_database = $alias_maps
smtpd_sender_login_maps = proxy:pgsql:@@SYSCONFDIR@@/postfix/pgsql-users.cf
local_recipient_maps = $smtpd_sender_login_maps $alias_maps
header_checks = regexp:@@SYSCONFDIR@@/postfix/header_checks
biff = no
append_dot_mydomain = no
delay_warning_time = 1h
mailbox_size_limit = 0
recipient_delimiter = +
notify_classes = resource, software, bounce
smtpd_helo_required = yes
smtpd_delay_reject = yes
# SMTP TLS
smtp_tls_CApath = /etc/ssl/certs
smtp_tls_security_level = may
smtp_tls_note_starttls_offer = yes
smtpd_tls_cert_file = @@SYSCONFDIR@@/@@LETSENCRYPT_DOMAIN_PART@@/fullchain.pem
smtpd_tls_key_file = @@SYSCONFDIR@@/@@LETSENCRYPT_DOMAIN_PART@@/privkey.pem
smtpd_tls_security_level = may
smtpd_tls_protocols = !SSLv2, !SSLv3
# Restrictions
smtpd_sender_restrictions = reject_known_sender_login_mismatch,
permit_sasl_authenticated,
check_sender_access inline:{{$myorigin=553 not logged in}},
reject_invalid_helo_hostname,
reject_unknown_sender_domain
smtpd_relay_restrictions = permit_sasl_authenticated,
permit_mynetworks,
reject_unauth_destination
smtpd_recipient_restrictions = permit_sasl_authenticated,
permit_mynetworks,
reject_unauth_destination
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_helo_restrictions = reject_invalid_helo_hostname
# Dovecot auth
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = unix:/var/run/dovecot/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myorigin
# Dovecot LMTP
mailbox_transport = lmtp:unix:/var/run/dovecot/lmtp
# Rspamd
milter_protocol = 6
milter_default_action = accept
smtpd_milters = inet:localhost:11332
non_smtpd_milters = $smtpd_milters
allow_mail_to_commands = alias,forward,include