cat $MESSAGE | formail -rt -I "Reply-To: $BOARD" \
-I "Errors-To: $MUNGED_ADDRESS" \
-I "X-Webstump-Event: reject $REASON" \
- -I 'Bcc: webstump+urcm-internal-log+mailout' \
- -I 'Bcc: webstump+urcm-internal-reject-copy'
+ $MAILOUT_REJECT_FORMAIL_ARGS
(
echo "$EXPLANATION"
echo
echo ""
echo ============================================ Full text of your message follows
- sed 's/^/> /; s/webstump+[-+/0-9a-z]*@chiark/webstump+?@chiark/' \
- < $MESSAGE
+ sanitise_and_quote_email \
+ < $MESSAGE
) | gpg --clearsign --textmode --armor --batch --user "$PMUSER_APPROVAL" \
--passphrase "$PMPASSWORD" 2>/dev/null \
) | sendmail -oi -t -f $MUNGED_ADDRESS
-Thank you for your submission to uk.rec.cycling.moderated.
+Thank you for your submission to %GROUP%.
However, we regret to inform you that your message has been rejected
because it was rude, a flame, and/or personal abuse.
-Thank you for your submission to uk.rec.cycling.moderated.
+Thank you for your submission to %GROUP%.
However, we regret to inform you that your message has been rejected
because it was not in accordance with the charter - for example,
-Thank you for your submission to uk.rec.cycling.moderated.
+Thank you for your submission to %GROUP%.
However, we regret to inform you that your message has been rejected
because it was crossposted. The moderators do not currently permit
-Thank you for your submission to uk.rec.cycling.moderated.
+Thank you for your submission to %GROUP%.
However, we regret to inform you that your message has been rejected
because we feel it was needlessly inflammatory.
-Thank you for your submission to uk.rec.cycling.moderated.
+Thank you for your submission to %GROUP%.
However, we regret to inform you that your message has been rejected
because it is a posting about moderation decisions, and we feel it is
-Thank you for your submission to uk.rec.cycling.moderated.
+Thank you for your submission to %GROUP%.
However, we regret to inform you that your message has been rejected
because it is a repetitious posting which we feel does not bring new
-Thank you for your submission to uk.rec.cycling.moderated.
+Thank you for your submission to %GROUP%.
However, we regret to inform you that your message has been rejected
because it was posted in a thread that had strayed off topic and was
(
cat $@ | formail -rt -I "Reply-To: $NOACK" \
-I "X-Webstump-Event: approve" \
- -I 'Bcc: %OURUSER%+%ABBREV%-internal-log+mailout'
+ $MAILOUT_ACCEPTACK_FORMAIL_ARGS
cat <<_EOB_
Hello,
_EOB_
- sed 's/^/> /; s/%OURUSER%+[-+/0-9a-z]*@%DOMAIN%/%OURUSER%+?@%DOMAIN%/' \
+ sanitise_and_quote_email \
$@
+
) | sendmail -t -f $MUNGED_ADDRESS
(
formail -rt -I "Reply-To: $NOACK" \
-I "X-Webstump-Event: ack" \
- -I 'Bcc: %OURUSER%+%ABBREV%-internal-log+mailout' \
+ $MAILOUT_RECVACK_FORMAIL_ARGS \
< $TMPFILE
cat <<_EOB_
Hello,
_EOB_
- sed 's/^/> /; s/%OURUSER%+[-+/0-9a-z]*@%DOMAIN%/%OURUSER%+?@%DOMAIN%/' \
+ sanitise_and_quote_email \
< $TMPFILE
+
) | sendmail -t -f $MUNGED_ADDRESS
rm $TMPFILE
#!/bin/bash
+###
#
# MAIN CONFIGURATION FILE
#
NEWSGROUP="%GROUP%"; export NEWSGROUP
+#######################################################################
+# Email handling and mangling
+
+MAILOUT_RECVACK_FORMAIL_ARGS='
+ -I Bcc:%OURUSER%+%ABBREV%-internal-log+mailout@%DOMAIN%
+'
+MAILOUT_ACCEPTACK_FORMAIL_ARGS='
+ -I Bcc:%OURUSER%+mtm-internal-log+mailout@%DOMAIN%
+'
+MAILOUT_REJECT_FORMAIL_ARGS='
+ -I Bcc:%OURUSER%+%ABBREV%-internal-log+mailout@%DOMAIN%
+ -I Bcc:%OURUSER%+%ABBREV%-internal-reject-copy@%DOMAIN%
+'
+
+sanitise_and_quote_email () {
+ perl -pe '
+ s/ %OURUSER% \+ [-+/0-9a-z]* \@
+ (\Q %DOMAIN% | %SLIMYDOMAIN \E) \b
+ /%OURUSER%+?\@$1/igx
+ unless m/^$/..0;
+ s/^/> /;
+ ' "$@"
+}
+
#######################################################################
# STUMP enforces limitations on the maximum number of newsgroups
# used in Newsgroups: header line. The default value is 5. I
#
# this MUST be dfined EVEN if PGP is set to "none".
# This goes into your Approved: field.
-PMUSER_APPROVAL="%GROUP% approval key <urcm-moderators@chiark.greenend.org.uk>"
+PMUSER_APPROVAL="%GROUP% approval key <%MODEMAIL%>"
export PMUSER_APPROVAL
######################################################################
# a devnulled address, since a lot of rejections/acks will bounce
# and there is no need for a human being to see the bounces.
#
-MUNGED_ADDRESS=%OURUSER%+urcm-bounces@%DOMAIN%
+MUNGED_ADDRESS=%OURUSER%+%ABBREV%-bounces@%DOMAIN%
export MUNGED_ADDRESS
######################################################################
# address for the no-ack requests.
-NOACK=%OURUSER%+urcm-noack@chiark.greenend.org.uk
+NOACK=%OURUSER%+%ABBREV%-noack@chiark.greenend.org.uk
export NOACK
######################################################################
# Official address for submissions to the newsgroup.
#
-SUBMIT=%OURUSER%+urcm+%KEYSUBMIT%@chiark.greenend.org.uk; export SUBMIT
+SUBMIT=%OURUSER%+%ABBREV%+%KEYSUBMIT%@chiark.greenend.org.uk; export SUBMIT
###################################################################### Flags
#
+++ /dev/null
-# Please check if all the paths in PATH are reachable, remove the ones that
-# are not.
-#
-# NOTE: I use lockfiles extensively (and even excessively) because
-# I do not want to overburden the system. Since I am on a
-# PPP link that is not always on, sometimes large amounts of
-# submissions come in simultaneously and that may impair
-# performance of the overall system. You do not REALLY need
-# to use these lockfiles otherwise.
-#
-# STUMP USERS:
-#
-# * Go through this file and replace urcm and
-# uk.rec.cycling.moderated with appropriate text for
-# your own group.
-#
-# * Please remove recipes related to user "mkagalen". He is not
-# likely to bother you.
-#
-# * Replace "ichudov" with the address of the robomod supporter.
-#
-# good luck. igor
-#
-###################################################################
-
-PATH=/bin:/usr/bin:/usr/local/bin:$HOME/stump/bin:$HOME/stump/etc
-MAILDIR=$HOME/Mail # You'd better make sure it exists
-DEFAULT=$MAILDIR/mbox
-# VERBOSE=ON
-LOGFILE=$MAILDIR/from
-LOCKFILE=$HOME/.lockmail
-
-:0 c
-$MAILDIR/allmail
-
-############################################################ Begin Mailbombing
-:0:
-* ^(From|Sender): .*mkagalen@lynx.dac.neu.edu
-* TOurcm-board
-$MAILDIR/bomb
-
-:0:
-* ^(From|Sender): .*mkagalen@lynx.dac.neu.edu
-* TOurcm-mods
-$MAILDIR/bomb
-
-:0
-* ^From: .*mkagalen@lynx.dac.neu.edu
-* ^Subject: .*Spongiform
-$MAILDIR/bomb
-
-:0:
-* From: "The Filter of mkagalen@lynx"
-$MAILDIR/bomb
-
-#
-# This recipe removes duplicates!
-#
-:0 Wh: msgid.lock
-| formail -D 32768 msgid.cache
-
-
-############################################################ End Mailbombing
-
-# Cabal maillist
-:0
-* ^From .*uu.net
-* ^To: urcm-board
-| modenv mods-message moderators@isc.org ADVICE
-
-:0
-* ^From .*uu.net
-* ^TOmoderators
-| modenv mods-message moderators@isc.org ADVICE
-
-:0
-* ^From .*isc.org
-* ^TOmoderators
-| modenv mods-message moderators@isc.org ADVICE
-
-
-###################################################################### Standard
-
-:0
-* ^TOurcm-mods
-| modenv mods-message urcm-mods@algebra.com
-
-:0
-* ^TOurcm-board
-| modenv mods-message urcm-mods@algebra.com
-
-:0
-* ^TOurcm-noack
-| modenv stump.pl processNoack.pl
-
-:0
-* ^TOsoc-culture-russian-moderated
-| modenv stump.pl submission.pl
-
-:0
-* ^TOuk.rec.cycling.moderated
-| modenv stump.pl submission.pl
-
-
-:0
-* ^TOurcm-approved
-| formail -c | modenv stump.pl acceptFromMod.pl
-
-:0
-* ^TOurcm-rejected
-| modenv stump.pl acceptFromMod.pl
-
-:0
-* ^TOurcm-admin
-!ichudov
-
-:0
-* ^TOurcm-approval-key
-| modenv send_pgp_key
-
-:0
-* ^Newsgroups:
-| modenv stump.pl submission.pl
-
-:0
-* ^FROM_DAEMON
-!ichudov
-
-:0
-* ^FROM_MAILER
-!ichudov
-
-# Anything that has not been delivered by now is a submission
-:0
-| modenv stump.pl submission.pl