confgure external services for prosody
[ansible.git] / roles / email / files / mailman-check
1 #!/bin/bash
2 set -e
3 ## Usage:
4 ##   ./mailman-check
5 ## Checks all the mailman lists for bad configuration, and prints further details if it finds one.
6
7 for list in $(list_lists -b); do
8     /usr/sbin/config_list -c -i /dev/stdin "$list" <<EOF
9 if not ((mlist.dmarc_moderation_action in (1, 2) and mlist.dmarc_quarantine_moderation_action == 1) or mlist.from_is_list in (1, 2)):
10     print "List",mlist.real_name,"by",(', '.join(mlist.owner)),"is not configured to deal with DMARC."
11 if mlist.reply_goes_to_list != 0 and not mlist.first_strip_reply_to:
12     print "List",mlist.real_name,"by",(', '.join(mlist.owner)),"provides an inconsistent Reply-To treatment."
13 if mlist.generic_nonmember_action == 2:
14     print "List",mlist.real_name,"by",(', '.join(mlist.owner)),"is prone to backscatter spam due to reject notifications"
15 if mlist.generic_nonmember_action == 1 and mlist.respond_to_post_requests:
16     print "List",mlist.real_name,"by",(', '.join(mlist.owner)),"is prone to backscatter spam due to hold notifications"
17 if mlist.bounce_unrecognized_goes_to_list_owner:
18     print "List",mlist.real_name,"by",(', '.join(mlist.owner)),"may spam the owner with unrecognized bounce notifications"
19 EOF
20 done