[plug] MIME Types by file contents

Bernd Felsche bernie at innovative.iinet.net.au
Mon Jul 5 17:47:38 WST 2004


On Monday 05 July 2004 17:05, Craig Ringer wrote:
> Bernd Felsche wrote:
> > I've narrowed this down to what could be a bug in the Message module
> > os Python 2.2's email package; either the __str__(), as_string() or
> > set_payload() methods.
> >
> > Inserting a blank line at the start of the problematic files, which
> > are saved Usenet articles, works around the problem.

> Hmm. That should cause the module to read the entire lot as body text,
> with no headers. That would tend to suggest a bug in the Message class
> or one of its subclasses to do with parsing text/news headers. Is it
> definitely made to be able to handle news articles?

There's no documented limitation on what set_payload() handles.
A subsequent get_payload() produces the correct result, regardless
of encoding. That brings as_string() to the top of the list of likely
offenders. The trace shows that Generator() is called and various
type-specific handlers are called for each part. It's pretty heavy
going for me trying to figure out what's supposed to be happening in
the Generator.py

> > Any suggestions, other than automagically inserting the blank line
> > for text/news type files?

> No idea, sorry. I haven't worked with text/news at all.

It's just plain text. Looks roughly like an email message but has a
Path: header and a few other bits. See attached sample.

-- 
/"\ Bernd Felsche - Innovative Reckoning, Perth, Western Australia
\ /  ASCII ribbon campaign | I'm a .signature virus!
 X   against HTML mail     | Copy me into your ~/.signature
/ \  and postings          | to help me spread!

-------------- next part --------------
You recently emailed me due to a listing imported from:

[ ] http://relays.osirusoft.com (inputs dialups)
[ ] http://SPEWS.org (spews)
[ ] http://spamsites.org (spamsites)
[ ] http://spamhaus.org (spamhaus)
[ ] socks at relays.osirusoft.com  (socks)

You should have:

[ ] followed the procedures at the above referenced site.
[ ] emailed the proxy handler
[ ] Read the faq at http://relays.osirusoft.com/faq.html
[ ] just about anything other than bother me.
[ ] emailed joejared at relays.osirusoft.com instead of
joejared at osirusoft.com
[ ] emailed retest at relays.osirusoft.com instead of mailbombing me you
	[ ] arrogant
	[ ] twit

Your message has been redirected to:

[ ] The site(s) that has yours listed
[ ] news:news.admin.net-abuse.email
[ ] spam-L
[ ] another place that has entertainment value
[ ] The high priority round filing cabinet
[ ] a bottomless pit

Further, you indicated that:

[ ] a long wooden object has been rectally inserted
	and that I should
	[ ] remove it
	[ ] spin on it
	[ ] set it on fire and fart

You also suggested that
[ ] I'm a{n} [insert colorful metaphor]

[ ] you are going to sue me if I don't 
	[ ] immediately remove your listing and
		[ ] no, I didn't visit your website
		[ ] no, I didn't take reading comprehension 101
		[ ] I'm confused
		[ ] kiss my anal quarters
	[ ] stop using spews
	[ ] stop using spamhaus
	[ ] stop using spamsites
	[ ] stop being a smartass


At which point I respond with:

[ ] If you feel froggy, jump
[ ] Seeya in court -click-
[ ] Google.groups.com seems to think so too.
[ ] Thanks.
[ ] ouch!  Damn cats.



More information about the plug mailing list