update mailman configuration

This commit is contained in:
Emmanuel Garette 2022-03-20 21:14:13 +01:00
parent e233dc1ffe
commit 7751bdf2d1
8 changed files with 20 additions and 17 deletions

View file

@ -5,7 +5,7 @@ if [ -z "$HOST_NAME" ]; then
echo "usage: $0 host name" echo "usage: $0 host name"
exit 1 exit 1
fi fi
apt install --yes systemd-container dnf jq debootstrap htop apt install --yes systemd-container dnf jq debootstrap htop gettext
systemd-tmpfiles --create --clean --remove $PWD/host/configurations/$HOST_NAME/tmpfiles.d/0asystemd-nspawn.conf systemd-tmpfiles --create --clean --remove $PWD/host/configurations/$HOST_NAME/tmpfiles.d/0asystemd-nspawn.conf
systemd-tmpfiles --create --clean --remove $PWD/host/configurations/$HOST_NAME/tmpfiles.d/0rougail.conf systemd-tmpfiles --create --clean --remove $PWD/host/configurations/$HOST_NAME/tmpfiles.d/0rougail.conf
systemctl daemon-reload systemctl daemon-reload

View file

@ -1,12 +1,11 @@
from risotto.utils import multi_function as _multi_function from risotto.utils import multi_function as _multi_function
from itertools import chain from itertools import chain
@_multi_function @_multi_function
def mailman_emails(lists, domain): def mailman_emails(lists, domain):
ret = [] ret = []
for lst in lists: for lst in lists:
for suffix in [None, 'bounces', 'confirm', 'join', 'leave', 'owner', 'request', 'subscribe', 'unsubscribe']: for suffix in [None, 'bounces(\+.*)?', 'confirm(\+.*)?', 'join', 'leave', 'owner', 'request', 'subscribe', 'unsubscribe']:
if suffix: if suffix:
lst_name = lst + '-' + suffix lst_name = lst + '-' + suffix
else: else:

View file

@ -6,3 +6,7 @@ chmod +x "$IMAGE_NAME_RISOTTO_IMAGE_DIR/usr/share/postorius/manage.py"
ln -s /etc/mailman3.d/postorius.py "$IMAGE_NAME_RISOTTO_IMAGE_DIR/usr/share/postorius/m_postorius/settings_local.py" ln -s /etc/mailman3.d/postorius.py "$IMAGE_NAME_RISOTTO_IMAGE_DIR/usr/share/postorius/m_postorius/settings_local.py"
ln -s ../../django_mailman3/static/django-mailman3 "$IMAGE_NAME_RISOTTO_IMAGE_DIR/$PYTHON/postorius/static/" ln -s ../../django_mailman3/static/django-mailman3 "$IMAGE_NAME_RISOTTO_IMAGE_DIR/$PYTHON/postorius/static/"
ln -s ../../django/contrib/admin/static/admin "$IMAGE_NAME_RISOTTO_IMAGE_DIR/$PYTHON/postorius/static/" ln -s ../../django/contrib/admin/static/admin "$IMAGE_NAME_RISOTTO_IMAGE_DIR/$PYTHON/postorius/static/"
#translation
msgfmt $IMAGE_NAME_RISOTTO_IMAGE_DIR/$PYTHON/postorius/locale/fr/LC_MESSAGES/django.po -o $IMAGE_NAME_RISOTTO_IMAGE_DIR/$PYTHON/postorius/locale/fr/LC_MESSAGES/django.mo
sed -i 's/$event.mlist.fqdn_listname\./$event.mlist.fqdn_listname/g' $IMAGE_NAME_RISOTTO_IMAGE_DIR/$PYTHON/mailman/messages/fr/LC_MESSAGES/mailman.po
msgfmt $IMAGE_NAME_RISOTTO_IMAGE_DIR/$PYTHON/mailman/messages/fr/LC_MESSAGES/mailman.po -o $IMAGE_NAME_RISOTTO_IMAGE_DIR/$PYTHON/mailman/messages/fr/LC_MESSAGES/mailman.mo

View file

@ -172,7 +172,7 @@ AUTH_PASSWORD_VALIDATORS = [
# Internationalization # Internationalization
# https://docs.djangoproject.com/en/1.9/topics/i18n/ # https://docs.djangoproject.com/en/1.9/topics/i18n/
LANGUAGE_CODE = 'en-us' LANGUAGE_CODE = 'fr'
TIME_ZONE = 'UTC' TIME_ZONE = 'UTC'

View file

@ -40,6 +40,7 @@ SOCIALACCOUNT_PROVIDERS = {
'ACCOUNT_USERNAME_REQUIRED': False, 'ACCOUNT_USERNAME_REQUIRED': False,
'ACCOUNT_AUTHENTICATION_METHOD': 'email', 'ACCOUNT_AUTHENTICATION_METHOD': 'email',
'SOCIALACCOUNT_AUTO_SIGNUP': True, 'SOCIALACCOUNT_AUTO_SIGNUP': True,
'VERIFIED_EMAIL': True,
}, },
} }
#FIXME #FIXME

View file

@ -6,4 +6,10 @@
<variable name="criteria_" description="transport criteria" type="string" multi="True" mandatory="True" hidden="True" provider="lmtp_criteria"/> <variable name="criteria_" description="transport criteria" type="string" multi="True" mandatory="True" hidden="True" provider="lmtp_criteria"/>
</family> </family>
</variables> </variables>
<constraints>
<fill name="calc_postfix_relay_domains">
<param type="variable">lmtp.lmtp_.criteria_</param>
<target>postfix_relay_domains</target>
</fill>
</constraints>
</rougail> </rougail>

View file

@ -1,6 +1,9 @@
%for %%domain in %%lmtp.server_lmtp %for %%domain in %%lmtp.server_lmtp
%set %%name=%%normalize_family(%%domain) %set %%name=%%normalize_family(%%domain)
%for %%lst in %%lmtp['lmtp_' + name]['criteria_' + %%name] %for %%lst in %%lmtp['lmtp_' + name]['criteria_' + %%name]
%%lst lmtp:[%%domain]:8024 %if '@' not in %%lst
%set %%lst = '.*@' + %%lst
%end if
/^%%lst$/ lmtp:[%%domain]:8024
%end for %end for
%end for %end for

View file

@ -350,19 +350,9 @@ mynetworks = 172.0.0.0/8
# #
#relay_domains = $mydestination #relay_domains = $mydestination
#>GNUNUX #>GNUNUX
%set %%relay = %%set() relay_domains = %echo ', '.join(%%postfix_relay_domains)
%for %%domain in %%lmtp.server_lmtp
%set %%name=%%normalize_family(%%domain)
%for %%lst in %%lmtp['lmtp_' + name]['criteria_' + %%name]
%if '@' in %%lst
%set %%lst = %%lst.split('@')[1]
%end if
%%relay.add(%%lst)%slurp
%end for
%end for
relay_domains = %echo ', '.join(%%relay)
%if %%lmtp.server_lmtp %if %%lmtp.server_lmtp
transport_maps = hash:/etc/postfix/lmtp transport_maps = regexp:/etc/postfix/lmtp
%end if %end if
#<GNUNUX #<GNUNUX