projects
/
pgarchives.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9424b71
)
Avoid taking message content from something that looks like an attachment
author
Magnus Hagander
<magnus@hagander.net>
Wed, 20 Jun 2012 20:08:22 +0000
(22:08 +0200)
committer
Magnus Hagander
<magnus@hagander.net>
Wed, 20 Jun 2012 20:08:22 +0000
(22:08 +0200)
loader/lib/parser.py
patch
|
blob
|
blame
|
history
diff --git
a/loader/lib/parser.py
b/loader/lib/parser.py
index a8f8920f323a012899ef58170b29834c2de0c494..dd8d215b4de107ec5785188c5458743043fabfcf 100644
(file)
--- a/
loader/lib/parser.py
+++ b/
loader/lib/parser.py
@@
-100,6
+100,9
@@
class ArchivesParser(object):
print "Found multipart/mixed in message '%s', but no MIME type on part. Trying text/plain." % self.msgid
return self.get_payload_as_unicode(p)
if p.get_params()[0][0].lower() == 'text/plain':
+ # Don't include it if it looks like an attachment
+ if p.has_key('Content-Disposition') and p['Content-Disposition'].startswith('attachment'):
+ continue
return self.get_payload_as_unicode(p)
if p.is_multipart():
b = self.recursive_first_plaintext(p)