[Mimedefang] Case in-sentitive matching

Roedel, Mark MarkRoedel at letu.edu
Wed Apr 14 19:03:16 EDT 2004


One simple way would be to force the whole match into upper case.  I.e.:

    if (($type eq "text/plain") and 
toupper($entity->head->mime_attr("content-type.charset")) eq
"WINDOWS-1251") { 

(Not tested, and I've had a long enough day that I've probably managed
to something glitchy there, but at least in principle...)

--
Mark Roedel
Web Programmer / Analyst
LeTourneau University
Longview, Texas  USA


-----Original Message-----
From: mimedefang-bounces at lists.roaringpenguin.com
[mailto:mimedefang-bounces at lists.roaringpenguin.com] On Behalf Of Ashley
M. Kirchner
Sent: Wednesday, April 14, 2004 5:54 PM
To: mimedefang at lists.roaringpenguin.com
Subject: [Mimedefang] Case in-sentitive matching


    In my sub filter, I have the following three lines:

    if (($type eq "text/plain") and 
$entity->head->mime_attr("content-type.charset") eq "Windows-1251") {
        return action_bounce("Charset Windows-1251 not accepted here");
    }

    ...which successfully bounces anything matching that charset.  
However, it's case sensitive.  Those that come in as "windows-1251" 
still get through.  Is there an easy way to match for both, without 
having to duplicate those three lines simply to add the lowercase
version?




More information about the MIMEDefang mailing list