Great Circle Associates

Majordomo-Users
(April 1999)


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

Subject: Re: file attachements
From: "Glen Lee Edwards" <glenlee@inebraska.com>
Date: Wed, 14 Apr 1999 19:58:59 -0500
To: <majordomo-users@GreatCircle.COM>

Nick,

I was thinking about your regex (I'm using something similar in a program I'm
writing), and on second thought it won't work.  The reason is that anything
enclosed in [ ] is implicitly "or'd."  The line:

>>/Content-Type: [^Text\/Plain]\;/i

tells PERL that within the square brackets to look for anything that is not T, nor
e, nor x, nor t, etc.  It doesn't read "Text" as sequential letters, but rather as
"or'd" letters.

You might try:

/Content-Type: text\/(?!plain)\;/i

This stands a better chance of working.  Some time ago I read through a small
portion of the PERL Majordomo script.  It had in it a line that deleted anything
from the list name that wasn't a letter, number, "_" or "-".  If the program does
this also in the configure commands then your line will be stripped to:

Content-Type textplain

It also might us the quotemeta() function.  If so the line will be neutered.

Hope this helps!

Glen


>
>-----Original Message-----
>From: Nick Allan <nallan@imailbox.com>
>To: majordomo-users@GreatCircle.COM <majordomo-users@GreatCircle.COM>
>Date: Friday, April 09, 1999 3:04 PM
>Subject: file attachements
>
>
>>Hi all
>>I'm trying to get majordomo to filter out file attachements, this would
>>also include html, all I want to allow through are plain text messages
>>I have the following regexp in the taboo_headers section
>>/Content-Type: [^Text\/Plain]\;/i
>>
>>I'm not sure if this is correct or not.
>>Its supposed to mean that anything with Content-Type: followed by anything
>>other than Text/Plain should be rejected.
>>Can anyone tell me if this is correct or not? I'm new at regular
>>expressions.
>>
>>thanks in advance for your help.
>>
>>
>>Regards Nick
>> nallan@imailbox.com
>>
>>
>
>



Indexed By Date Previous: Re: Majordomo install problems
From: root <root@mail.hacktrack.com>
Next: Re: Adding Footers to posted messages
From: Kevin Hancock <khan@arcom.com.au>
Indexed By Thread Previous: file attachements
From: Nick Allan <nallan@imailbox.com>
Next: Regular expressions in Text Area
From: "Haisam K. Ido" <idoh@cais.com>