chiark / gitweb /
Big changes to fully configure for group
[modbot-mtm.git] / stump / etc / mods-message
diff --git a/stump/etc/mods-message b/stump/etc/mods-message
new file mode 100755 (executable)
index 0000000..3d3c4c7
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# This script sends an email to a group of people listed in
+# env var RECIPIENTS (we create this var here from etc/moderators)
+#
+# It is used to maintain the little internal mailing list for all
+# human moderators of your newsgroup.
+#
+
+FILTER="NO_$2_LIST";
+
+RECIPIENTS="`cat $MNG_ROOT/etc/moderators \
+            | grep -v "$FILTER"               \
+             | grep -v '^#'               \
+             | awk '{print $1;}'          \
+             | tr '\n' ',' `"
+
+(
+     formail                                                            \
+       -I "To: discard-all@chiark.greenend.org.uk"                     \
+       -I "From " -I "Cc:"                                              \
+       -I "X-Loop: $BOARD"                                             \
+       -I "X-Mailing-List: $BOARD ($NEWSGROUP Moderators)"             \
+       -I "Reply-To: $1"                                               \
+       -I "Resent-To:"                                                 \
+       -I "X-Maintainer: $ADMIN"                                       \
+       -I "Errors-To: $ADMIN"
+     cat $MNG_ROOT/etc/mods.sig
+) | sed 's/^\.$/\.\./' | sendmail $RECIPIENTS