3 # This script takes a raw article that is already rejected, creates a
4 # reply message, signs it with PGP and sends back to the author.
7 # echo $0 invoked with arguments $@ 1>&2
9 MESSAGE=$TMP/rejected.$$
11 shift; REASON="$1"; export REASON; shift
12 #EXPLANATION="$@"; export EXPLANATION
14 echo Action: processRejected, reason=$REASON 1>&2
19 # procmail -p -f- $MNG_ROOT/etc/procmail/save-rejected < $MESSAGE
24 if [ "x$REASON" = xdiscard ]; then return; fi
26 cat $MESSAGE | formail -rt -I "Reply-To: $BOARD" \
27 -I "Errors-To: $MUNGED_ADDRESS" \
28 -I "X-Webstump-Event: reject $REASON" \
29 -I 'Bcc: webstump+urcm-internal-log+mailout' \
30 -I 'Bcc: webstump+urcm-internal-reject-copy'
35 if [ "x$REASON" != "xcustom" ] ; then
36 cat $MNG_ROOT/etc/messages/$REASON
40 echo ============================================ Full text of your message follows
41 sed 's/^/> /; s/webstump+[-+/0-9a-z]*@chiark/webstump+?@chiark/' \
43 ) | gpg --clearsign --textmode --armor --batch --user "$PMUSER_APPROVAL" \
44 --passphrase "$PMPASSWORD" 2>/dev/null \
45 ) | sendmail -oi -t -f $MUNGED_ADDRESS
48 update_rejection_count() {
49 # don't count forgeries and signature mismatches against the victim
50 # also don't count thread rejections or duplicates
51 if [ "x$REASON" != "xforgery" -a "x$REASON" != "xsignature" -a "x$REASON" != "xthread" -a "x$REASON" != "xduplicate" -a "x$REASON" != "xcrosspost" -a "x$REASON" != "xempty" ]; then
52 cat $MESSAGE | updateActionCount.pl -r
58 #update_rejection_count
61 # ) | stump-pgp -staf -z "$PMPASSWORD" \
62 # -u "$ROBOMOD_APPROVAL" +clearsig=on 2>/dev/null \