reorganize postfix/email role; drop meta/main.yml dependencies as they interact badly...
[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 if ! test -d /var/lib/mailman; then
8     # nothing to do
9     exit 0
10 fi
11
12 cd /var/lib/mailman/lists
13 for list in *; do
14     /usr/sbin/config_list  -i /dev/stdin "$list" <<EOF
15 if not ((mlist.dmarc_moderation_action in (1, 2) and mlist.dmarc_quarantine_moderation_action == 1) or mlist.from_is_list in (1, 2)):
16     print "List",mlist.real_name,"by",(', '.join(mlist.owner)),"is not configured to deal with DMARC."
17 if mlist.reply_goes_to_list != 0 and not mlist.first_strip_reply_to:
18     print "List",mlist.real_name,"by",(', '.join(mlist.owner)),"provides an inconsistent Reply-To treatment."
19 EOF
20 done