OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: regular expression with postfix

From: Tom Lee (tom_lee01hotmail.com)
Date: Mon Oct 02 2006 - 14:37:04 CDT


>From: Victor Duchovni <Victor.DuchovniMorganStanley.com>
>Reply-To: postfix-userspostfix.org
>To: Tom Lee <tom_lee01hotmail.com>
>CC: postfix-userspostfix.org
>Subject: Re: regular expression with postfix
>Date: Mon, 2 Oct 2006 15:22:48 -0400
>
>On Mon, Oct 02, 2006 at 07:12:14PM +0000, Tom Lee wrote:
>
> > here is what I used in header_checks:
> >
>/^(content-(type|disposition):.*;[[:space:]]*(file)?name[[:space:]]*=[[:space:]]*")([=\?]*([^."]*)\?=)(".*)/
> > REPLACE ${1}changed_filename${3}
> >
> > it doesn't work.
> > not sure if I missed something here?
>
>Yes, the [^."]* won't match the "." in "foo.jpg". Also approach is
>terrible, update your mail client software to something written this
>century.

how about using this solution?

/^(content-(type|disposition):.*;[[:space:]]*(file)?name[[:space:]]*=[[:space:]]*")([=\?]*([^\.|"]*)\?=)(".*)/
        REPLACE ${1}changed_filename${3}

it seems still unable to handle the case:
Content-Type: image/jpeg; name="=?utf-8?Q?=EC=8A=A4=EC=BA=9400111001.jpg?="
Content-Disposition: attachment;
filename="=?utf-8?Q?=EC=8A=A4=EC=BA=9400111001.
jpg?="

I am using microsoft outlook 2003.

Thanks.

Tom

_________________________________________________________________
Find a local pizza place, music store, museum and more…then map the best
route! http://local.live.com