add mailman-check
authorRalf Jung <post@ralfj.de>
Sun, 6 Dec 2015 16:22:21 +0000 (17:22 +0100)
committerRalf Jung <post@ralfj.de>
Sun, 6 Dec 2015 16:22:21 +0000 (17:22 +0100)
mailman-check [new file with mode: 0755]

diff --git a/mailman-check b/mailman-check
new file mode 100755 (executable)
index 0000000..bc512d7
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash
+set -e
+## Usage:
+##   ./mailman-check
+## Checks all the mailman lists for bad configuration, and prints further details if it finds one.
+
+cd /var/lib/mailman/lists
+for list in *; do
+    config_list  -i /dev/stdin "$list" <<EOF
+if not ((mlist.dmarc_moderation_action in (1, 2) and mlist.dmarc_quarantine_moderation_action == 1) or mlist.from_is_list in (1, 2)):
+    print "List",mlist.real_name,"by",(', '.join(mlist.owner)),"is not configured to deal with DMARC."
+if mlist.reply_goes_to_list != 0 and not mlist.first_strip_reply_to:
+    print "List",mlist.real_name,"by",(', '.join(mlist.owner)),"provides an inconsistent Reply-To treatment."
+EOF
+done