Commit 7c8a0989 authored by Yoann Pietri's avatar Yoann Pietri Committed by root

Mailman part 1

parent fc2b3c89
# Mailman part
- name: Install postfix clamav postgrey spamassassin amavis
apt:
pkg:
- postfix
- clamav
- postgrey
- spamassassin
- amavis
- name: Install mailman3-full
apt:
name: mailman3-full
state: latest
default_release: stretch-backports
# Postfix part
- name: Add mailman configuration to postfix
blockinfile:
path: /etc/postfix/main.cf
marker_begin: "BEGIN mailman configuration"
marker_end: "END mailman configuration"
block: |
MAILMAN
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
# Hyperkitty part
- name: Copy hyperkitty configuration
template:
src: mailman-hyperkitty.cfg
dest: /etc/mailman3/mailman-hyperkitty.cfg
owner: root
group: root
mode: 0644
- name: Append mailman telegram webhook to mailman configuration
blockinfile:
path: /etc/mailman3/mailman.cfg
marker_begin: "BEGIN Mailman hyperkitty"
marker_end: "END Mailman hyperkitty"
block: |
[archiver.hyperkitty]
class: mailman_hyperkitty.archiver
enable: yes
configuration: /etc/mailman3/mailman-hyperkitty.cfg
# Mailman telegram webook part
- name: Create directory for mailman telegram webhook
file:
path: /usr/lib/python3/dist-packages/mailman_telegram_webook/
state: directory
- name: Copy __init__.py for mailman telegram webhook
copy:
src: __init__.py
dest: /usr/lib/python3/dist-packages/mailman_telegram_webhook/__init__.py
owner: root
group: root
mode: 0644
- name: Copy mailman telegram webhook configuration
template:
src: mailman-telegram-webhook.cfg
dest: /etc/mailman3/mailman-telegram-webhook.cfg
owner: root
group: root
mode: 0644
- name: Append mailman telegram webhook to mailman configuration
blockinfile:
path: /etc/mailman3/mailman.cfg
marker_begin: "BEGIN Mailman telegram webhook"
marker_end: "END Mailman telegram webhhok"
block: |
[archiver.telegram_webhook]
class: mailman_telegram_webhook.Archiver
enable: yes
configuration: /etc/mailman3/mailman-telegram-webhook.cfg
# Apache part
- name: Install apache2
apt:
name: apache2
- name: Copy apache2 configuration file
copy:
src: mailman.conf
dest: /etc/apache2/sites-available/mailman.conf
owner: root
group: root
mode: 0644
- name: Enable mailman site
command: a2ensite mailman
# Restart services
- name: Restart mailman3
service:
name: mailman3
state: restarted
- name: Restart mailman3-web
service:
name: mailman3-web
state: restarted
- name: Restart postfix
service:
name: postfix
state: restarted
- name: Restart apache2
service:
name: apache2
state: restarted
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment