Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Avoid repeat Content-Transfer-Encoding
  • Loading branch information
destanyol committed Nov 26, 2024
commit ba07be214a8b6b2f44e593749b1c46369a2aa96d
3 changes: 1 addition & 2 deletions qreu/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,13 @@ def add_attachment(self, input_buff, attname=False):
if filetype:
splitedfiletype = filetype.split('/')[-1]
subtype = splitedfiletype
attachment = MIMEApplication('', _subtype=subtype)
attachment = MIMEApplication('', _subtype=subtype, _encoder=email.encoders.encode_base64)

attachment.set_charset('utf-8')
attachment.add_header(
'Content-Disposition',
'attachment; filename="%s"' % self.remove_accent(u'{}'.format(basename(filename)))
)
attachment.add_header('Content-Transfer-Encoding', 'base64')
attachment.set_payload(
attachment_str,
charset=attachment.get_charset()
Expand Down