email scanning for X-Spam-Score
jarausch at igpm.rwth-aachen.de
Mon May 25 07:23:58 EDT 2009
Peter Otten wrote:
> Helmut Jarausch wrote:
>> my emails received from our mailing system contain a field like
>> X-Spam-Score: -2.2
>> Given the full email message in 'msg'
>> I've tried
>> mailmsg = email.message_from_string(msg)
>> SPAM_CORE = mailmsg['X-Spam-Score']
>> but it doesn't work.
> What do you mean by "doesn't work"?
>> What am I missing?
> No idea. It seems to "work" over here:
> Python 2.6.2 (release26-maint, Apr 19 2009, 01:58:18)
> [GCC 4.3.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import email
>>>> spam = open("spam.txt").read()
>>>> m = email.message_from_string(spam)
> '15.0 (+++++++++++++++)'
Oh yes, thanks,
my test email was quite long and so I overlooked it contained 2 emails instead
of just one.
Sorry for the noise,
Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
More information about the Python-list