Compare commits

...

3 Commits

Author SHA1 Message Date
Raimon Esteve facc433a8b FIX in_replay_to when is none to split
From changeset-6ed5ae4
2023-05-09 17:32:11 +02:00
Bernat Brunet 6ed5ae4bac Fix 'in_replay_to' field, that in some cases the value could have
specials chars not allowed. Strip them.
It's detected in some Outlook mails (office365)
2023-05-09 16:00:17 +02:00
Bernat Brunet 6590c99efa Fix problme when try to getsizeof from the mail structure.
Change the way from actual 'str' to 'byte'. The actual 'str' could have
some problems with some special chars.
2023-05-09 15:35:18 +02:00
1 changed files with 3 additions and 2 deletions

View File

@ -560,7 +560,8 @@ class ElectronicMail(ModelSQL, ModelView):
'\n','').replace('\r', '')),
'date': mail_date,
'message_id': message_id,
'in_reply_to': _decode_header(mail.get('in-reply-to')),
'in_reply_to': _decode_header(mail.get('in-reply-to', '')).strip(
'\r\n\t'),
'deliveredto': _decode_header(
",".join(mail.get('delivered-to', '').replace(
'\t', '').splitlines())),
@ -571,7 +572,7 @@ class ElectronicMail(ModelSQL, ModelView):
",".join(mail.get('reply-to', '').replace(
'\t', '').splitlines())),
'mail_file': mail_file,
'size': getsizeof(mail.__str__()),
'size': getsizeof(mail.__bytes__()),
'resource': ('%s,%s' % (record.__name__, record.id)
if record else None),
}