From 65e9641271f57e4ae987e6bb48cd3e60c2bc8e7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 2 Aug 2017 22:52:12 +0200 Subject: [PATCH] Add Auto-Submitted header Recommended by RFC 3834. issue6673 review35211002 --- notification.py | 1 + tests/test_notification_email.py | 1 + 2 files changed, 2 insertions(+) diff --git a/notification.py b/notification.py index 8f7fd88226..2caef0d579 100644 --- a/notification.py +++ b/notification.py @@ -177,6 +177,7 @@ class Email(ModelSQL, ModelView): msg['Cc'] = ', '.join(cc) msg['Bcc'] = ', '.join(bcc) msg['Subject'] = Header(title, 'utf-8') + msg['Auto-Submitted'] = 'auto-generated' return msg def get_log(self, record, trigger, msg): diff --git a/tests/test_notification_email.py b/tests/test_notification_email.py index 598e7ccfa4..f4242d0102 100644 --- a/tests/test_notification_email.py +++ b/tests/test_notification_email.py @@ -94,6 +94,7 @@ class NotificationEmailTestCase(ModuleTestCase): self.assertEqual(msg['From'], FROM) self.assertEqual(msg['Subject'], 'Notification Email') self.assertEqual(msg['To'], 'Administrator ') + self.assertEqual(msg['Auto-Submitted'], 'auto-generated') self.assertEqual(msg.get_content_type(), 'multipart/alternative') self.assertEqual( msg.get_payload(0).get_payload(), 'Hello Michael Scott')