Correct handling of e-mail attachments where the name is encoded in rfc2231. Thanks to Sergey Kirillov for the patch, which closes Google Code issue #154 and Github issue #11.

This commit is contained in:
Ross Poulton 2011-01-29 06:25:53 +00:00
parent 8f15febe23
commit 2d7d3c489d

View File

@ -18,7 +18,7 @@ import re
from datetime import datetime, timedelta
from email.header import decode_header
from email.Utils import parseaddr
from email.Utils import parseaddr, collapse_rfc2231_value
from optparse import make_option
from django.core.files.base import ContentFile
@ -177,6 +177,8 @@ def ticket_from_message(message, queue, quiet):
continue
name = part.get_param("name")
if name:
name = collapse_rfc2231_value(name)
if part.get_content_maintype() == 'text' and name == None:
if part.get_content_subtype() == 'plain':