I've attached a simple patch to https://fedorahosted.org/koji/ticket/248 which
adds the RFC 2822 "Date" header to emails generated by kojid and koji-gc.
Perhaps someone with more internal knowledge of Koji can review it.

Thanks.  -A

--
Anthony - https://messinet.com/ - https://messinet.com/~amessina/gallery
8F89 5E72 8DF0 BCF0 10BE 9967 92DC 35DC B001 4A4E
 builder/kojid | 5 +++++
 util/koji-gc  | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/builder/kojid b/builder/kojid
index a1b3a11..da1409b 100755
--- a/builder/kojid
+++ b/builder/kojid
@@ -47,6 +47,7 @@ import smtplib
 import socket
 import sys
 import time
+from time import gmtime, strftime
 import traceback
 import xml.dom.minidom
 import xmlrpclib
@@ -3858,6 +3859,7 @@ class TagNotificationTask(BaseTaskHandler):
 """From: %(from_addr)s\r
 Subject: %(nvr)s %(result)s %(operation)s by %(user_name)s\r
 To: %(to_addrs)s\r
+Date: %(msg_date)s\r
 X-Koji-Package: %(pkg_name)s\r
 X-Koji-NVR: %(nvr)s\r
 X-Koji-User: %(user_name)s\r
@@ -3890,6 +3892,7 @@ Status: %(status)s\r

         from_addr = self.options.from_addr
         to_addrs = ', '.join(recipients)
+        msg_date = strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime())

         operation = '%(action)s'
         operation_details = 'Tag Operation: %(action)s\r\n'
@@ -3946,6 +3949,7 @@ class BuildNotificationTask(BaseTaskHandler):
 """From: %(from_addr)s\r
 Subject: %(subject)s\r
 To: %(to_addrs)s\r
+Date: %(msg_date)s\r
 X-Koji-Tag: %(dest_tag)s\r
 X-Koji-Package: %(build_pkg_name)s\r
 X-Koji-Builder: %(build_owner)s\r
@@ -4118,6 +4122,7 @@ Build Info: %(weburl)s/buildinfo?buildID=%(build_id)i\r

         from_addr = self.options.from_addr
         to_addrs = ', '.join(recipients)
+        msg_date = strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime())
         subject = self.subject_templ % locals()
         message = self.message_templ % locals()
         # ensure message is in UTF-8
diff --git a/util/koji-gc b/util/koji-gc
index 871c7f8..9bc15c6 100755
--- a/util/koji-gc
+++ b/util/koji-gc
@@ -23,6 +23,7 @@ import smtplib
 import socket   # for socket.error
 import sys
 import time
+from time import gmtime, strftime
 import xmlrpclib  # for ProtocolError and Fault


@@ -422,6 +423,7 @@ refer to the document linked above for instructions."""
         msg['Subject'] = "%i builds marked for deletion" % len(builds)
     msg['From'] = options.from_addr
     msg['To'] = "%s@%s" % (owner_name, options.email_domain)  #XXX!
+    msg['Date'] = "%s" % strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime())
     msg['X-Koji-Builder'] = owner_name
     if options.test:
         if options.debug:

Attachment: signature.asc
Description: This is a digitally signed message part.

--
buildsys mailing list
[email protected]
https://admin.fedoraproject.org/mailman/listinfo/buildsys

Reply via email to