From 77bf6ecc9e901d2e72fd04d5b4123c77fb434191 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Sun, 12 Jul 2020 23:59:14 +0200 Subject: [PATCH] Postfix mailman3 configuration --- .../templates/mailman3/mailman.cfg.j2 | 1 - roles/postfix-mailman3/tasks/main.yml | 10 +--- .../templates/postfix/main.cf.j2 | 60 +++++++++++++++++++ 3 files changed, 61 insertions(+), 10 deletions(-) create mode 100644 roles/postfix-mailman3/templates/postfix/main.cf.j2 diff --git a/roles/mailman3/templates/mailman3/mailman.cfg.j2 b/roles/mailman3/templates/mailman3/mailman.cfg.j2 index 326e08df..5b9a5d9f 100644 --- a/roles/mailman3/templates/mailman3/mailman.cfg.j2 +++ b/roles/mailman3/templates/mailman3/mailman.cfg.j2 @@ -271,4 +271,3 @@ lmtp_port: 8024 # .cfg, which the file must end with. #configuration: python:mailman.config.exim4 configuration: python:mailman.config.postfix - diff --git a/roles/postfix-mailman3/tasks/main.yml b/roles/postfix-mailman3/tasks/main.yml index 87161f4f..94752197 100644 --- a/roles/postfix-mailman3/tasks/main.yml +++ b/roles/postfix-mailman3/tasks/main.yml @@ -16,15 +16,7 @@ owner: root group: root loop: [] -# - main.cf -# - master.cf -# - transport -# - mime_header_checks -# - recipient_access -# - sender_login_maps -# - postscreen_access.cidr -# - sasl/smtpd.conf -# - client_checks + - main.cf notify: Restart postfix - name: Indicate role in motd diff --git a/roles/postfix-mailman3/templates/postfix/main.cf.j2 b/roles/postfix-mailman3/templates/postfix/main.cf.j2 new file mode 100644 index 00000000..075d162f --- /dev/null +++ b/roles/postfix-mailman3/templates/postfix/main.cf.j2 @@ -0,0 +1,60 @@ +{{ ansible_header | comment }} +# See /usr/share/postfix/main.cf.dist for a commented, more complete version +# This postfix configuration set up a MTA only to send and receive mailing list mails + +# When a mail is sent to @localhost, this domain will be used +myorigin = crans.org + +smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU) +biff = no + +# Uncomment the next line to generate "delayed mail" warnings +#delay_warning_time = 4h + +# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on +# fresh installs. +compatibility_level = 2 + +# Use self-signed Debian generated cert for local TLS +# 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 + +# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for +# information on enabling SSL in the smtp client. + +# Default aliases +alias_maps = hash:/etc/aliases +alias_database = hash:/etc/aliases + +# Send to main mail server +relayhost = smtp.adm.crans.org + +# Only localhost +mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 + +# Listen on IPv4 and IPv6 +inet_interfaces = all +inet_protocols = all + +# Do not use gethostname +myhostname = {{ ansible_hostname }}.crans.org +mydomain = crans.org + +# Softbounce, ask remote mail server to send the mail again if error +# Do not keep it active in production! +soft_bounce = no + +# Mailman3 integration +recipient_delimiter = + +unknown_local_recipient_reject_code = 550 +owner_request_special = no +transport_maps = + hash:/var/lib/mailman3/data/postfix_lmtp +local_recipient_maps = + hash:/var/lib/mailman3/data/postfix_lmtp +relay_domains = + hash:/var/lib/mailman3/data/postfix_domains