Modify ↓
Opened 18 years ago
Closed 12 years ago
#1412 closed defect (wontfix)
Add a "Date:" header to the mail
Reported by: | grg | Owned by: | Alec Thomas |
---|---|---|---|
Priority: | normal | Component: | WikiNotifyScript |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.10 |
Description (last modified by )
Hello,
I've installed trac-wiki-notify and one user reported that his mail client shows the date as follows:
Date: 12/31/69
This is because trac-wiki-notify does not add any Date: header, and some mail clients show a weird default date instead.
I've modified trac-wiki-notify to add the Date: header and would like to contribute this feature for further inclusion into the official version. Here is the patch:
-
trac-wiki-notify
old new 35 35 import sys 36 36 import smtplib 37 37 import re 38 39 # line added by grg@openwall.com 40 from time import tzname, timezone, daylight, altzone 41 38 42 from time import strftime, localtime, time 39 43 44 # function added by grg@openwall.com 45 def grg_tz_offset(): 46 lt = localtime() 47 if lt.tm_isdst > 0 and daylight: 48 tz = tzname[1] 49 utc_offset_minutes = - int(altzone/60) 50 else: 51 tz = tzname[0] 52 utc_offset_minutes = - int(timezone/60) 53 utc_offset_str = "%+03d%02d" % (utc_offset_minutes/60.0, utc_offset_minutes % 60) 54 return utc_offset_str 55 56 # function added by grg@openwall.com 57 def grg_timestamp(): 58 return strftime('%a, %d %b %Y %H:%M:%S ' + grg_tz_offset()) 59 40 60 if len(sys.argv) < 5: 41 61 raise StandardError("Not enough arguments") 42 62 … … 82 102 for email in smtp_to: 83 103 smtp_body = "From: %s\n" % smtp_from 84 104 smtp_body += "To: %s\n" % email 105 # line added by grg@openwall.com 106 smtp_body += "Date: %s\n" % grg_timestamp() 85 107 smtp_body += "Reply-To: %s\n" % smtp_from 86 108 smtp_body += "Subject: Notification of %i changes to Trac Wiki %s\n\n" % (len(changes), trac_url) 87 109 smtp_body += email_body
Attachments (1)
Change History (4)
Changed 18 years ago by
Attachment: | trac-wiki-notify.header.date.diff added |
---|
comment:1 Changed 18 years ago by
comment:3 Changed 12 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
This script is deprecated. Please take a look at the AnnouncerPlugin and WatchlistPlugin.
Note: See
TracTickets for help on using
tickets.
The patch is not correctly displayed by the wiki, please see the file trac-wiki-notify.header.date.diff attached to this ticket.