* dAniel hAhler <[EMAIL PROTECTED]> writes:
> on Wed, 03. Mar 2004 at 22:27:44 +0100 Carsten Th�nges wrote:

> Thanks for your answer, but are you sure that you tested it with a
> Sorting Filter (and not "plain" QT)?

Hm, no, sorry :-)

> from re import sub, search
> from string import strip
> text = '''%TEXT'''

> text = sub('(?i)(Delivered-To: xxxxxxxxxxxxxxx'\
>             
> '|((X-POPFile-Link|X-Text-Classification|X-GMX-Antispam|X-GMX-Antivirus): 
> ))[^\n]*\n', '', text)
> text = sub('(?i)(To|Message-ID|References|In-Reply-To): [^\n]*\n', r'\1: <snip>\n', 
> text)
> text = sub('(?i)((xxxxxxxx|xxxxxx)\s*)?[^\s]*xxxxxx[^\s;]*', '<snip>', text)

> text = text.strip()

> if not search(r'(\n\n)', text):
>    text = text + '\n\n' + 'Non-text-portions stripped..'

For tasks like that you might want to take a look at Python's email
module.

Carsten
-- 


________________________________________________________

http://www.silverstones.com/thebat/TBUDLInfo.html

Reply via email to