On Wed, Nov 26, 1997 at 12:11:31PM -0000, Mark Rauterkus wrote:
> PERL and Rebular Expression help needed for majordomo.cf file so as to
> bounce the BLACKLISTED Headers posted by Ron.
> What little I know comes below:
> 1. Put the two characters /^ at the start of every line.
> 2. Keep each black-listed header on its own line.
> 3. Any space or spaces between words needs to be transformed into the two
> char string as \s*
> 4. The end of line should have /i
More or less (I make no comment on quite how sensible the particular
list you cite is !). I'd be careful about no 3 though. Many of the
so-called rogue headers are very particular so I would refrain from
interpolating too much otherwise you may bounce OK stuff.
If you had those headers in a text file of their own you could use perl
to generate a series of regexps to be cut and paste into
(global_)taboo_headers:
perl -n -e 'chop; s/(\W)/\\$1/g; print "/$_/i\n";' < headers.txt \
>taboo.txt
> What I don't know: ??
> Resulting in: **** Warning this is a newbie posting -- do not use -- look
> for the summary to come **** end warning:
Not possible unless you are prepared to hack resend. Though you could
cheat and put a comment in each regexp so the text you wanted appeared
in the subject line of the bounced message. It would make the subject
line rather large though.
eg rather than
$global_taboo_headers = <<'END';
/^A-Bad-Header: Spam/i
END
do
$global_taboo_headers = <<'END';
/(?# *** WARNING THIS MAY BE SPAM ***)^A-Bad-Header: Spam/i
END
> $admin_headers = <<'END';
> /^Content-Type: multipart/mixed/i
[snip]
> /^Received:\s*\[alt/i
> /^Received:\s*\{alt
> END
No need to add the expressions to $admin_headers. global_taboo_headers
is enough.
Nick
--
Nick Perry | Home / Recreation | Work - AboarD |
| LONDON SW1, UK | LONDON SW6, UK |
| http://www.amulation.co.uk/nick | http://www.aboard.co.uk |
| nick.perry@amulation.co.uk | np@aboard.co.uk |
References:
|
|