Opened 14 years ago
Closed 14 years ago
#7417 closed defect (fixed)
[patch] Incorrect date on emails from Announcer
Reported by: | Tom | Owned by: | Steffen Hoffmann |
---|---|---|---|
Priority: | normal | Component: | AnnouncerPlugin |
Severity: | normal | Keywords: | email date |
Cc: | Ryan J Ollos | Trac Release: | 0.12 |
Description
The emails I'm receiving from Announcer are all dated 08/01/09 00:00:00
- any idea if this is a bug or whether I have mis-configured something? Any idea how I can fix it?
For reference, I'm using trac 0.12 on centOS 5.5 and I installed trunk of Announcer this morning, via:
easy_install --always-unzip http://trac-hacks.org/svn/fullblognotificationplugin/trunk trac-admin /var/www/trac/pph upgrade /etc/init.d/httpd restart
Initially, emails weren't being sent, but I installed IniAdminPlugin plugin and changed the "email_enabled" to true in the trac.ini ammouncer section.
Here is a dump of the [announcer]
section from trac.ini:
[announcer] admit_domains = always_notify_owner = true always_notify_reporter = true always_notify_updater = true announcer.api.announcementsystem = enabled announcer.distributors.mail.emaildistributor = enabled announcer.distributors.mail.sendmailemailsender = enabled announcer.distributors.mail.smtpemailsender = disabled announcer.email_decorators.generic.announceremaildecorator = enabled announcer.email_decorators.generic.staticemaildecorator = disabled announcer.email_decorators.generic.threadingemaildecorator = enabled announcer.email_decorators.ticket.ticketaddlheaderemaildecorator = enabled announcer.email_decorators.ticket.ticketsubjectemaildecorator = enabled announcer.email_decorators.wiki.wikisubjectemaildecorator = enabled announcer.email_enabled = enabled announcer.filters.change_author.changeauthorfilter = enabled announcer.filters.unsubscribe.unsubscribefilter = disabled announcer.formatters.ticket.ticketformatter = enabled announcer.formatters.wiki.wikiformatter = enabled announcer.opt.acct_mgr.announce.accountmanagerannouncement = disabled announcer.pref.announcerpreferences = enabled announcer.producers.attachment.attachmentchangeproducer = enabled announcer.producers.ticket.ticketchangeproducer = enabled announcer.producers.wiki.wikichangeproducer = enabled announcer.resolvers.defaultdomain.defaultdomainemailresolver = disabled announcer.resolvers.sessionemail.sessionemailresolver = disabled announcer.resolvers.specified.specifiedemailresolver = disabled announcer.subscribers.ticket_compat.carboncopysubscriber = disabled announcer.subscribers.ticket_compat.legacyticketsubscriber = disabled announcer.subscribers.ticket_components.ticketcomponentsubscriber = enabled announcer.subscribers.ticket_custom.ticketcustomfieldsubscriber = enabled announcer.subscribers.ticket_groups.joinablegroupsubscriber = enabled announcer.subscribers.watch_users.userchangesubscriber = disabled announcer.subscribers.watchers.watchsubscriber = enabled announcer.subscribers.wiki.generalwikisubscriber = enabled ctxtnav_names = Watch ThisUnwatch This email_enabled = true ignore_domains = mime_encoding = base64 smtp_always_bcc = smtp_always_cc = smtp_default_domain = smtp_enabled = true smtp_from = trac@localhost smtp_from_name = peopleperhour.com Trac smtp_password = smtp_port = 25 smtp_replyto = trac@localhost smtp_server = localhost smtp_subject_prefix = __default__ smtp_user = ticket_subject_template = $prefix TKT $ticket.id ($summary) use_public_cc = false use_short_addr = false use_tls = false
Attachments (0)
Change History (5)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
Cc: | Ryan J Ollos added; anonymous removed |
---|---|
Keywords: | email date added |
Owner: | changed from Robert Corsaro to Steffen Hoffmann |
Status: | new → assigned |
Summary: | Incorrect date on emails from Announcer → [patch] Incorrect date on emails from Announcer |
Thanks for reporting and your investigation. As you mentioned, I didn't spot it by now, since I run a Thunderbird clone here. But I confirm, can see it in the plain-text source view as well.
Certainly we'll want to fix the root cause, but your suggestion is still a good start for someone in need of workaround right now.
comment:3 Changed 14 years ago by
Related ticket: #7669 (TracAnnouncer: don't encode pure ASCII mail headers)
comment:5 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I investigated further, found the issue and have a workaround.
The
Date
in the emails is corrupted. It only happens on some emails and it only shows up in Evolution (not Outlook or Thunderbird because I guess they sort emails by the received date whereas Evolution is sorting by the date in email Header).announcer/distributors/mail.py
initially sets the Date header viaheaders['Date'] = formatdate()
, at this point it looks fine:But after
value = Header(value, charset, MAXHEADERLEN-(len(key)+2))
is called inset_header()
function inAnnouncerPlugin-0.12_p2.dev-py2.4.egg/announcer/announcer/util/mail.py
the date is corrupted:I don't know much about the encoding function but I have found I can fix my issue by making sure the date isn't encoded, e.g.
Hope this helps?