diff --git a/modoboa/webmail/lib/sendmail.py b/modoboa/webmail/lib/sendmail.py index 300646d0c..7635657e9 100644 --- a/modoboa/webmail/lib/sendmail.py +++ b/modoboa/webmail/lib/sendmail.py @@ -96,12 +96,13 @@ def schedule_email( mattachment = models.MessageAttachment( message=sched_msg, ) - if "content-type" in attachment: - mattachment.content_type = attachment["content-type"] - elif "Content-Type" in attachment: - mattachment.content_type = attachment["Content-Type"] - else: + for header in ["content-type", "Content-Type"]: + if header in attachment: + mattachment.content_type = attachment[header] + break + if not mattachment.content_type: continue + mattachment.file.name = attachment["tmpname"] if "fname" in attachment: mattachment.filename = attachment["fname"] diff --git a/modoboa/webmail/tests/test_viewsets.py b/modoboa/webmail/tests/test_viewsets.py index 6801256cf..f4c6febfd 100644 --- a/modoboa/webmail/tests/test_viewsets.py +++ b/modoboa/webmail/tests/test_viewsets.py @@ -419,6 +419,7 @@ class ComposeSessionViewSetTestCase(WebmailTestCase): { "sender": self.user.email, "to": ["test@example.test"], + "cc": ["cc@example.test"], "subject": "test", "body": "Test", "scheduled_datetime": scheduled_datetime.isoformat(),