Opened 8 years ago

Closed 8 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


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
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:

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 = enabled
announcer.email_enabled = enabled
announcer.filters.change_author.changeauthorfilter = enabled
announcer.filters.unsubscribe.unsubscribefilter = disabled
announcer.formatters.ticket.ticketformatter = enabled = enabled
announcer.opt.acct_mgr.announce.accountmanagerannouncement = disabled
announcer.pref.announcerpreferences = enabled
announcer.producers.attachment.attachmentchangeproducer = enabled
announcer.producers.ticket.ticketchangeproducer = enabled = 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 = 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 = Trac
smtp_password =
smtp_port = 25
smtp_replyto = trac@localhost
smtp_server = localhost
smtp_subject_prefix = __default__
smtp_user =
ticket_subject_template = $prefix TKT $ ($summary)
use_public_cc = false
use_short_addr = false
use_tls = false

Attachments (0)

Change History (5)

comment:1 Changed 8 years ago by Tom

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/ initially sets the Date header via headers['Date'] = formatdate(), at this point it looks fine:

Thu, 29 Jul 2010 14:43:43 -0000

But after value = Header(value, charset, MAXHEADERLEN-(len(key)+2)) is called in set_header() function in the date is corrupted:

Date: =?utf-8?b?VGh1LCAyOSBKdWwgMjAxMCAxNDo0Mzo0MyAtMDAwMA==?=

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.

     if key != 'Date':
        value = Header(value, charset, MAXHEADERLEN-(len(key)+2))

Hope this helps?

comment:2 Changed 8 years ago by Steffen Hoffmann

Cc: Ryan J Ollos added; anonymous removed
Keywords: email date added
Owner: changed from Robert Corsaro to Steffen Hoffmann
Status: newassigned
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 8 years ago by Tom

Related ticket: #7669 (TracAnnouncer: don't encode pure ASCII mail headers)

comment:4 Changed 8 years ago by Robert Corsaro

does #7669 fix this?

comment:5 in reply to:  4 Changed 8 years ago by Tom

Resolution: fixed
Status: assignedclosed

Replying to doki_pen:

does #7669 fix this?

Yes it does - tested this morning.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Steffen Hoffmann.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.