Add a domain aliases mechanism to lists.o.o

In order to be able to redirect list addresses which have moved from
one domain to another, we need a solution to alias the old addresses
to the new ones. We have simple aliases but they only match on the
local part. Add a new /etc/aliases.domain which matches full
local_part@domain addresses instead. Also collect this file in the
Mailman deployment test for ease of inspection.

Change-Id: I16f871e96792545e1a8cc8eb3834fa4eb82e31c8
This commit is contained in:
Jeremy Stanley 2021-12-15 22:02:36 +00:00
parent 2863b5a509
commit 1addce7dbc
4 changed files with 20 additions and 0 deletions

View File

@ -34,6 +34,7 @@ exim_aliases:
superuser-owner: spam
user-committee-owner: spam
spam: ':fail: delivery temporarily disabled due to ongoing spam flood'
exim_domain_aliases: {}
exim_routers:
- mailman_verp_router: |
{% raw -%}
@ -51,6 +52,13 @@ exim_routers:
transport = mailman_verp_smtp
- dnslookup: '{{ exim_dnslookup_router }}'
- system_aliases: '{{ exim_system_aliases_router }}'
- domain_aliases: |
driver = redirect
allow_fail
allow_defer
data = ${lookup{$local_part@$domain}lsearch{/etc/aliases.domain}}
file_transport = address_file
pipe_transport = address_pipe
- localuser: '{{ exim_localuser_router }}'
- mailman_copy: |
driver = accept

View File

@ -91,6 +91,11 @@
loop: "{{ mailman_sites }}"
loop_control:
loop_var: site
- name: Write /etc/aliases.domain
template:
src: "domain_aliases.j2"
dest: "/etc/aliases.domain"
mode: 0444
when: mailman_multihost
- name: normal mailman configs

View File

@ -0,0 +1,6 @@
# /etc/aliases.domain
{% for k, v in exim_domain_aliases|dictsort %}
{% if v %}
{{ k }}: {{ v }}
{% endif %}
{% endfor %}

View File

@ -270,6 +270,7 @@
'/var/log/mailman': logs
lists.openstack.org:
host_copy_output:
'/etc/aliases.domain': logs_txt
'/var/log/mailman': logs
- job: