Patch: add Date to email header

Report & discuss bugs found in SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
m00au
Newbie
Newbie
Posts: 6
Joined: February 15th, 2009, 6:58 am

Patch: add Date to email header

Post by m00au »

Some spam filters filter out emails missing the Date field.

Code: Select all

--- SABnzbd-0.4.6/sabnzbd/email.py    2008-12-12 09:05:20.000000000 +1100
+++ /usr/share/sabnzbd/sabnzbd/email.py 2009-02-16 20:01:03.000000000 +1100
@@ -117,8 +117,8 @@
                     return failure

         # Message header
-        msg = "From: %s\r\nTo: %s\r\nSubject: %s\r\nX-Priority: 5\r\nX-MS-Priority: 5\r\n\r\n" % \
-            (sabnzbd.EMAIL_FROM, sabnzbd.EMAIL_TO, header)
+        msg = "From: %s\r\nTo: %s\r\nDate: %s\r\nSubject: %s\r\nX-Priority: 5\r\nX-MS-Priority: 5\r\n\r\n" % \
+            (sabnzbd.EMAIL_FROM, sabnzbd.EMAIL_TO, time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime()), header)

         # Authentication
         if (sabnzbd.EMAIL_ACCOUNT != "") and (sabnzbd.EMAIL_PWD != ""):
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Patch: add Date to email header

Post by shypike »

Post Reply