Changeset - 29e10c6a1551
[Not reviewed]
0 1 0
Lance Edgar (lance) - 7 years ago 2018-02-22 13:15:54
lance@edbob.org
Add email attachment MIME type for MS Word .doc files
1 file changed with 1 insertions and 0 deletions:
0 comments (0 inline, 0 general)
rattail/mail.py
Show inline comments
 
@@ -440,12 +440,13 @@ class Email(object):
 
            if isinstance(attachment, six.string_types):
 
                attachment = self.normalize_attachment(attachment)
 
            normalized.append(attachment)
 
        return normalized
 

	
 
    ATTACHMENT_MIME_MAP = {
 
        '.doc': 'application/msword',
 
        '.pdf': 'pdf',
 
        '.xls': 'vnd.ms-excel',
 
    }
 

	
 
    def normalize_attachment(self, path):
 
        root, ext = os.path.splitext(path)
0 comments (0 inline, 0 general)