chiark / gitweb /
Big changes to fully configure for group
[modbot-mtm.git] / stump / etc / mods-message
1 #!/bin/sh
2 #
3 # This script sends an email to a group of people listed in
4 # env var RECIPIENTS (we create this var here from etc/moderators)
5 #
6 # It is used to maintain the little internal mailing list for all
7 # human moderators of your newsgroup.
8 #
9
10 FILTER="NO_$2_LIST";
11
12 RECIPIENTS="`cat $MNG_ROOT/etc/moderators \
13              | grep -v "$FILTER"               \
14              | grep -v '^#'               \
15              | awk '{print $1;}'          \
16              | tr '\n' ',' `"
17
18 (
19      formail                                                            \
20        -I "To: discard-all@chiark.greenend.org.uk"                      \
21        -I "From " -I "Cc:"                                              \
22        -I "X-Loop: $BOARD"                                              \
23        -I "X-Mailing-List: $BOARD ($NEWSGROUP Moderators)"              \
24        -I "Reply-To: $1"                                                \
25        -I "Resent-To:"                                                  \
26        -I "X-Maintainer: $ADMIN"                                        \
27        -I "Errors-To: $ADMIN"
28      cat $MNG_ROOT/etc/mods.sig
29 ) | sed 's/^\.$/\.\./' | sendmail $RECIPIENTS