chiark / gitweb /
Fix quoting to strip Receiveds
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 1 Mar 2010 12:29:03 +0000 (12:29 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 1 Mar 2010 12:29:03 +0000 (12:29 +0000)
stump/etc/sanitise_and_quote_email.INO

index 9446cd4..1526209 100755 (executable)
@@ -1,7 +1,12 @@
-#!/usr/bin/perl -p
+#!/usr/bin/perl -n
 
-s, %OURUSER% \+ [-+/0-9a-z]* \@ (\Q%DOMAIN%\E | \Q%SLIMYDOMAIN%\E) \b
-                ,%OURUSER%+?\@$1,igx
-       unless m/^$/..0;
+unless (m/^$/..0) {
+    $skip= 0 unless m/^[ \t]/;
+    $skip= 1 if m/^received\s*\:/i;
+    next if $skip;
+    s, %OURUSER% \+ [-+/0-9a-z]* \@ (\Q%DOMAIN%\E | \Q%SLIMYDOMAIN%\E) \b
+                ,%OURUSER%+?\@$1,igx;
+}
 
 s/^/> /;
+print or die $!;