Re: [exim] Is there any easier way to write/express somethin…

トップ ページ
このメッセージを削除
このメッセージに返信
著者: W B Hacker
日付:  
To: exim users
題目: Re: [exim] Is there any easier way to write/express something like this?
Responding to both in one go ...

Robert Nicholson wrote:
> The reason it's not formatted any other way is that I don't know what
> line continuation characters etc are supported by the regex library that
> exim is using.


...that is easily tested, is it not?

and earlier wrote:

> Well the two regular expresses are designed to isolate potential
> foreign language email and therefore I don't copy those to my backup
> folder.


Suggest breaking this up into 'many' short, single-purpose tests, paying
close attention to conditionals so that as few as possible are applied
at all.

At least for initial tests, 'log_message =' lines that identify WHICH
test were run will make debugging and adjusting faster.

You may then identify and re-combine ONLY those which are always
triggered on the same criteria, AND actually do something more useful
w/r decision support than just parsing every message presented.

That last part tells the tale - given that 'legitimate' messages in
perfect Engish arrive here every day in messages bearing any of about a
dozen source-encodings, I'd not hold my breath that the end result is
all that useful in a 'globalized' world.

HTH,

Bill




>
> On Sep 18, 2008, at 11:03 AM, W B Hacker wrote:
>
>> Robert Nicholson wrote:
>>> These regex's get a bit unwieldy ... can this be data driven thru a
>>> file or can this regex be written/formatted so that it's more readable?
>>>
>>> if foranyaddress $header_to:,$header_cc: ( $thisaddress matches ^robert
>>> \@elastic
>>> a.com\$ ) and ( $header_content-type: does not match "\\s*=\\?
>>> (ks_c_5601-|big5|e
>>> uc-|shift-jis|(iso.\{0,4\}639-)|hkscs|sil|koi[78]|iscii|guobiao|gb2312|
>>> gb18030|(
>>> iso.\{0,4\}2022)|(iso.\{0,4\}8859-[57])|(windows-1251)|
>>> (windows-1255))" or $head
>>> er_subject: does not match "\\s*=\\?(ks_c_5601-|big5|euc-|shift-jis|
>>> (iso.\{0,4\}
>>> 639-)|hkscs|sil|koi[78]|iscii|guobiao|gb2312|gb18030|(iso.\{0,4\}2022)|
>>> (iso.\{0,
>>> 4\}8859-[57])|(windows-1255))" )
>>>
>>
>> *Until* it is written to be more readable, the rather smallish number
>> here who have the expertise to grok it may not bother...
>>
>> What - in Peter-Rabbit English - is it intended to *accomplish*?
>>
>> A donut vs coin-of-whatever-realm still has value sez there are several
>> ways to do {whatever} - though not necessarily in one step.
>>
>> Standing by ...
>>
>> Bill Hacker
>>
>> --## List details at http://lists.exim.org/mailman/listinfo/exim-users
>> ## Exim details at http://www.exim.org/
>> ## Please use the Wiki with this list - http://wiki.exim.org/
>
>