Great Circle Associates Majordomo-Users
(November 1997)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: Confusion on Admin-Headers regular expression strings
From: Nick Perry <nick . perry @ amulation . co . uk>
Date: Wed, 26 Nov 1997 18:24:42 +0000
To: Mark Rauterkus <mrauterkus @ sportsurf . net>
Cc: majordomo-users @ GreatCircle . COM
In-reply-to: <199711261601.JAA25514@sportsurf.net>; from Mark Rauterkus on Wed, Nov 26, 1997 at 12:11:31PM -0000
References: <199711261601.JAA25514@sportsurf.net>

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:
Indexed By Date Previous: Confusion on Admin-Headers regular expression strings
From: Mark Rauterkus <mrauterkus@sportsurf.net>
Next: Re: List owner vs. moderator password?
From: Ernest Mueller <ernestm@towery.com>
Indexed By Thread Previous: Confusion on Admin-Headers regular expression strings
From: Mark Rauterkus <mrauterkus@sportsurf.net>
Next: Way to kick messages with excessive quoting?
From: Mission Recording and Audio <dan@missionrec.com>

Google
 
Search Internet Search www.greatcircle.com