chiark / gitweb /
Make sanitise_and_quote_email into a script
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 28 Feb 2010 21:25:50 +0000 (21:25 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 28 Feb 2010 21:25:50 +0000 (21:25 +0000)
.gitignore
stump/etc/modenv.INO
stump/etc/sanitise_and_quote_email.INO [new file with mode: 0755]

index 661170f1bcda5bde427d17a4f814dbba0140ac49..180fe791a69d4ec9d53cca0afb99892ebde37d61 100644 (file)
@@ -25,6 +25,7 @@
 /stump/etc/modack.approved.new
 /stump/etc/modack.received.new
 /stump/etc/moderators
+/stump/etc/sanitise_and_quote_email
 /stump/etc/messages/*[^N]?
 /sballot/issues
 /inews
index eebf1d508d3ee0199321f1db48c1153ab37e5302..e403b4237e4eff01b230b48343de2d149a22e1f1 100755 (executable)
@@ -10,6 +10,8 @@
 # to real moderation scripts. Follow the instructions.
 #
 
+set -e
+
 #######################################################################
 # this is the root directory where moderation software & config
 # resides. Make sure that sendmail is in the PATH.
@@ -49,16 +51,6 @@ MAILOUT_REJECT_FORMAIL_ARGS='
        -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
diff --git a/stump/etc/sanitise_and_quote_email.INO b/stump/etc/sanitise_and_quote_email.INO
new file mode 100755 (executable)
index 0000000..a62f349
--- /dev/null
@@ -0,0 +1,7 @@
+#!/usr/bin/perl -p
+
+s, %OURUSER% \+ [-+/0-9a-z]* \@ (\Q %DOMAIN% | %SLIMYDOMAIN \E) \b
+                ,%OURUSER%+?\@$1,igx
+       unless m/^$/..0;
+
+s/^/> /;