timezone naive code in _send_bug_details_to_new_bug_subscribers sends mail from the future

Bug #393325 reported by Michael Hudson-Doyle
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
New
Undecided
Unassigned

Bug Description

The launchpad servers are currently running in UTC+1 (British Summer Time).

The mail that gets sent when you are assigned to a bug has a Date header like this:

Date: Mon, 29 Jun 2009 04:04:09 -0000

But Received headers like this:

Received: from gandwana.canonical.com (localhost.localdomain [127.0.0.1])
 by gandwana.canonical.com (Postfix) with ESMTP id 774A3450039
 for <email address hidden>; Mon, 29 Jun 2009 04:04:10 +0100 (BST)

The date header is wrong.

Looking in mailnotification.py quickly I can see that the code is timezone-naive, but I don't know what the correct fix is, necessarily. It might be as simple as:

    # Now's a good a time as any for this email; don't use the original
    # reported date for the bug as it will just confuse mailer and
    # recipient.
    email_date = datetime.datetime.now(pytz.UTC)

Tags: lp-bugs
description: updated
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.