[calm - Cygwin server-side packaging maintenance script] branch master, updated. 20160705-57-gdebaf7a

jturney@sourceware.org jturney@sourceware.org
Sat Apr 8 13:42:00 GMT 2017




https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=debaf7a24f5c21ba130c6ffd8cbcd5486f57bd0a

commit debaf7a24f5c21ba130c6ffd8cbcd5486f57bd0a
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Sat Apr 8 14:12:31 2017 +0100

    Ensure calm's email have Message-Id: and Date: headers


Diff:
---
 calm/buffering_smtp_handler.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/calm/buffering_smtp_handler.py b/calm/buffering_smtp_handler.py
index 13fca18..0025a5b 100644
--- a/calm/buffering_smtp_handler.py
+++ b/calm/buffering_smtp_handler.py
@@ -24,6 +24,7 @@
 import logging
 import logging.handlers
 import email.message
+import email.utils
 
 from . import common_constants
 
@@ -56,6 +57,8 @@ class BufferingSMTPHandler(logging.handlers.BufferingHandler):
             m['To'] = ','.join(self.toaddrs)
             m['Bcc'] = common_constants.ALWAYS_BCC
             m['Subject'] = self.subject
+            m['Message-Id'] = email.utils.make_msgid()
+            m['Date'] = email.utils.formatdate()
             m['X-Calm'] = '1'
 
             # use utf-8 only if the message can't be ascii encoded



More information about the Cygwin-apps-cvs mailing list