From 17276d0d3113c972daea261287315bb7271c730f Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Wed, 24 Apr 2024 18:02:00 +0000 Subject: [PATCH] Override upstream ADMINS address for mailman Deliveries to root@localhost don't work, use the same as the from address instead. Change-Id: Id509f652be3b4b6f77edc85161aed7200f672571 --- playbooks/roles/mailman3/files/web-settings.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/playbooks/roles/mailman3/files/web-settings.py b/playbooks/roles/mailman3/files/web-settings.py index b6dcf7e580..415c16d24b 100644 --- a/playbooks/roles/mailman3/files/web-settings.py +++ b/playbooks/roles/mailman3/files/web-settings.py @@ -2,7 +2,7 @@ # # This file has been copied from: # https://github.com/maxking/docker-mailman/blob/ab8dfb3/web/mailman-web/settings.py -# In order to override the ALLOWED_HOSTS and SITE_ID settings. +# In order to override the ALLOWED_HOSTS, SITE_ID and ADMINS settings. # # Copyright (C) 1998-2016 by the Free Software Foundation, Inc. # @@ -44,9 +44,10 @@ SECRET_KEY = os.environ.get('SECRET_KEY') # SECURITY WARNING: don't run with debug turned on in production! DEBUG = False -ADMINS = ( - ('Mailman Suite Admin', 'root@localhost'), -) +# Upstream sets ADMINS here, but we set it later after SERVER_EMAIL is defined. +#ADMINS = ( +# ('Mailman Suite Admin', 'root@localhost'), +#) # Magic value to perform automatic domain guessing SITE_ID = 0 @@ -220,6 +221,11 @@ hostname = os.environ.get('SERVE_FROM_DOMAIN', 'localhost.local') DEFAULT_FROM_EMAIL = 'postorius@{}'.format(hostname) SERVER_EMAIL = 'root@{}'.format(hostname) +# Errors go to these addresses +ADMINS = ( + ('Mailman Suite Admin', SERVER_EMAIL), +) + # Change this when you have a real email backend EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = os.environ.get('SMTP_HOST', '')