Implement the requested features (as far as possible)

This commit is contained in:
Crest 2021-02-10 15:32:59 +01:00
parent 5f24e0449d
commit 25167bc296
2 changed files with 68 additions and 1 deletions

View File

@ -266,7 +266,7 @@
label: '{{ item.name }}@{{ item.domain }}' label: '{{ item.name }}@{{ item.domain }}'
with_items: '{{ mlmmj_lists }}' with_items: '{{ mlmmj_lists }}'
- name: Moderate subscription - name: Set moderate subscription
copy: copy:
dest: '/var/vmail/mlmmj/{{ item.name }}/control/submod' dest: '/var/vmail/mlmmj/{{ item.name }}/control/submod'
content: '' content: ''
@ -278,3 +278,67 @@
loop_control: loop_control:
label: '{{ item.name }}@{{ item.domain }}' label: '{{ item.name }}@{{ item.domain }}'
with_items: '{{ mlmmj_lists }}' with_items: '{{ mlmmj_lists }}'
- name: Unset moderate subscription
file:
path: '/var/vmail/mlmmj/{{ item.name }}/control/submod'
state: absent
when: not (item.subscription_moderated | default(false))
loop_control:
label: '{{ item.name }}@{{ item.domain }}'
with_items: '{{ mlmmj_lists }}'
- name: Limit posts to subscribers
copy:
dest: '/var/vmail/mlmmj/{{ item.name }}/control/subonlypost'
content: ''
force: no
owner: mlmmj
group: mlmmj
mode: 0444
when: item.subscribers_only | default(false)
loop_control:
label: '{{ item.name }}@{{ item.domain }}'
with_items: '{{ mlmmj_lists }}'
- name: Allow off list posts
file:
path: '/var/vmail/mlmmj/{{ item.name }}/control/subonlypost'
state: absent
when: not (item.subscribers_only | default(false))
loop_control:
label: '{{ item.name }}@{{ item.domain }}'
with_items: '{{ mlmmj_lists }}'
- name: Moderate posts from non subscribers
copy:
dest: '/var/vmail/mlmmj/{{ item.name }}/control/modnonsubposts'
content: ''
force: no
owner: mlmmj
group: mlmmj
mode: 0444
when: item.moderate_nonsubscribers | default(false)
loop_control:
label: '{{ item.name }}@{{ item.domain }}'
with_items: '{{ mlmmj_lists }}'
- name: Deny posts from non subscribers
file:
path: '/var/vmail/mlmmj/{{ item.name }}/control/modnonsubposts'
state: absent
when: not (item.moderate_nonsubscribers | default(false))
loop_control:
label: '{{ item.name }}@{{ item.domain }}'
with_items: '{{ mlmmj_lists }}'
- name: Generate list of moderators
template:
dest: '/var/vmail/mlmmj/{{ item.name }}/control/moderators'
src: moderators.j2
owner: mlmmj
group: mlmmj
mode: 0444
loop_control:
label: '{{ item.name }}@{{ item.domain }}'
with_items: '{{ mlmmj_lists }}'

View File

@ -0,0 +1,3 @@
{% for moderator in item.moderators | default([]) %}
{{ moderator }}
{% endfor %}