diff --git a/docbow_project/docbow/management/commands/sendmail.py b/docbow_project/docbow/management/commands/sendmail.py index c530476..59f9812 100644 --- a/docbow_project/docbow/management/commands/sendmail.py +++ b/docbow_project/docbow/management/commands/sendmail.py @@ -107,14 +107,15 @@ In case of failure the following return value is returned: except models.FileType.DoesNotExist: content_errors.append('The subject "%s" does not match any known file type' % subject) for part in mail.walk(): - filename = self.decode_filename(part.get_filename(None)) + filename = part.get_filename(None) if part.get_content_type() == 'text/plain' and \ ('Content-Disposition' not in part or 'inline' in part['Content-Disposition']): charset = part.get_content_charset('us-ascii') description = unicode(part.get_payload(decode=True), charset) if filename: - attachments.append((filename, part.get_payload(decode=True))) + attachments.append((self.decode_filename(filename), + part.get_payload(decode=True))) for email_address in all_recipients: try: user = auth_models.User.objects.get(email=email_address, delegations_by__isnull=True)