#68 : added "application" mime main type to handled attachments.

This commit is contained in:
tonio
2010-06-18 09:52:21 +02:00
parent 233e695a55
commit 97265e45af
2 changed files with 14 additions and 2 deletions
+5 -1
View File
@@ -148,10 +148,14 @@ class Email(object):
if part.has_key("Content-Disposition"):
if re.match("^attachment", part["Content-Disposition"]):
self.attachments += [part]
continue
if part.get_content_type() in ("text/html", "text/plain"):
contents[part.get_content_subtype()] += part.get_payload(decode=True)
if mode != "html" or links == "0":
continue
if part.get_content_maintype() == "application":
self.attachments += [part]
continue
if part.get_content_maintype() == "image":
if part.has_key("Content-Location"):
@@ -159,7 +163,7 @@ class Email(object):
if re.match("^http:", fname):
path = fname
else:
path = os.path.abspath("static/tmp" + fname)
path = os.path.abspath("static/tmp/" + fname)
fp = open(path, "wb")
fp.write(part.get_payload(decode=True))
fp.close()