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 661170f..180fe79 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 eebf1d5..e403b42 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/^/> /;