Re: [exim] Mime + filename matching

Pàgina inicial
Delete this message
Reply to this message
Autor: Craig Jackson
Data:  
A: exim-users
Assumpte: Re: [exim] Mime + filename matching


> -----Original Message-----
> From: exim-users-bounces@???
> [mailto:exim-users-bounces@exim.org] On Behalf Of Phil Pennock
> Sent: Friday, February 08, 2008 3:41 PM
> To: Craig Jackson
> Cc: exim-users@???
> Subject: Re: [exim] Mime + filename matching
>
> On 2008-02-08 at 10:10 -0600, Craig Jackson wrote:
> >         condition = ${if or { \
> >                 {

> >
> match{${lc:$mime_filename}}{\N^(?>.*)(?<=zip|emz|iso|wma|jpg|j

peg|pps|pp
> > t|gif|png|wmv|mpg|mp3|mpeg|avi|wav|bmp|mov|asf|asx|mpe)\N}} \
> >                 {

> >
> match{${lc:$mime_content_type}}{\N^(zip|emz|iso|wma|jpg|jpeg|p

ps|ppt|gif
> > |png|wmv|mpg|mp3|mpeg|avi|wav|bmp|mov|asf|asx|mpe)\N}} \
> >                 }{1}{0}}
> >         set acl_m7 = 1

> >
> > This acl works perfectly except for certain emails and I'm not smart
> > enough to figure out how to get Exim to work to work with
> those emails.
>
> > --____RAAJBJVHFFDKGUUJDDWU____
> > Content-ID: <LTPCYOQCHLLK.GW}00014.BMP>
> > Content-Type: image/BMP
> > Content-Transfer-Encoding: base64
> >
> > Seems to me that the acl should have seen that MIME boundary and set
> > acl_m7 to 1. Can someone please tell me why it didn't?
>
> The match condition does a regexp comparison; unlike 'regexp
> as an item
> in a list' it doesn't default to case-insensitive.
>
> $ exim -be
> > ${if match{foo}{\N^f[aeiou].$\N} {w00t}{bah}}
> w00t
> > ${if match{FOO}{\N^f[aeiou].$\N} {w00t}{bah}}
> bah
> > ${if match{foo}{\N(?i)^f[aeiou].$\N} {w00t}{bah}}
> w00t
> > ${if match{FOO}{\N(?i)^f[aeiou].$\N} {w00t}{bah}}
> w00t
> >
>
> By putting "(?i)" in the regexp before the literal
> characters, you make
> sure that they're interpreted in a case-insensitive manner.
>
> "man pcrepattern" and "INTERNAL OPTION SETTING".
>
> -Phil


Thanks for relying, Phil.

Case did occur to me, so that's why I used ${lc:$mime_filename}
Wouldn't that take care of case?