1
0
forked from infra/ansible

mail: Add mailman3 hyperkitty archiver config

This commit is contained in:
Kishi85 2022-05-11 15:18:00 +02:00
parent 69348ed49b
commit 93e01f3650
4 changed files with 40 additions and 1 deletions

View File

@ -143,6 +143,10 @@
template: src=mailman/mailman.cfg.j2 dest=/etc/mailman3/mailman.cfg
notify: Restart mailman3
- name: Configure mailman3 hyperkitty plugin
template: src=mailman/mailman-hyperkitty.cfg.j2 dest=/etc/mailman3/mailman-hyperkitty.cfg
notify: Restart mailman3
- name: Configure mailman3-web
template: src=mailman/mailman-web.py.j2 dest=/etc/mailman3/mailman-web.py
notify: Restart mailman3web

View File

@ -0,0 +1,21 @@
# This is the mailman extension configuration file to enable HyperKitty as an
# archiver. Remember to add the following lines in the mailman.cfg file:
#
# [archiver.hyperkitty]
# class: mailman_hyperkitty.Archiver
# enable: yes
# configuration: /etc/mailman3/mailman-hyperkitty.cfg
#
[general]
# This is your HyperKitty installation, preferably on the localhost. This
# address will be used by Mailman to forward incoming emails to HyperKitty
# for archiving. It does not need to be publicly available, in fact it's
# better if it is not.
#base_url: http://localhost/mailman3/hyperkitty/
base_url: https://{{ mailman_domain }}/mailman3/hyperkitty/
# Shared API key, must be the identical to the value in HyperKitty's
# settings.
api_key: {{ mailman3_archiverkey }}

View File

@ -25,7 +25,16 @@ MAILMAN_REST_API_URL = 'http://localhost:8001'
MAILMAN_REST_API_USER = 'restadmin'
MAILMAN_REST_API_PASS = '{{ mailman3_restadminpass }}'
MAILMAN_ARCHIVER_KEY = '{{ mailman3_archiverkey }}'
MAILMAN_ARCHIVER_FROM = ('127.0.0.1', '::1')
MAILMAN_ARCHIVER_FROM = (
'127.0.0.1',
'::1',
{% if hostvars[inventory_hostname]['ansible_default_ipv4']['address'] is defined %}
'{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address']}}',
{% endif%}
{% if hostvars[inventory_hostname]['ansible_default_ipv6']['address'] is defined %}
'{{ hostvars[inventory_hostname]['ansible_default_ipv6']['address']}}',
{% endif%}
)
# Application definition

View File

@ -68,3 +68,8 @@ smtp_pass:
lmtp_host: 127.0.0.1
lmtp_port: 8024
configuration: python:mailman.config.postfix
[archiver.hyperkitty]
class: mailman_hyperkitty.Archiver
enable: yes
configuration: /etc/mailman3/mailman-hyperkitty.cfg