Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

ActionMailer only works correctly with sent_on set in in the local time zone

#3113

When you set the sent_on time on a mail to a time that is not in the local time zone the date in the TMail that is created.

This is because TMail assumes times are in the local time zone.

For example assuming your local time zone is PDT. Setting the sent_on time to Time.local(2004, 12, 12, 1), will give the correct date header "Sun, 12 Dec 2004 01:00:00 -0800". However setting the sent_on time to Time.local(2004, 12, 12, 1).utc, will incorrectly set the date header "Sun, 12 Dec 2004 09:00:00 -0800".

The attached patch fixes this by ensuring the ActionMailer converts times to the local time zone before passing to TMail.

This is a problem in both 2-3-stable and master and the patch should apply cleanly to both.

Reported by Joel Chippindale · August 28th, 2009 @ 10:42 AM

State: stale
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. cainlevy
    cainlevy
    • Tag changed from actionmailer, timezone to 2-3-stable, actionmailer, timezone

    Fixed the problem for me. +1

    October 9th, 2009 @ 10:57 PM

  2. cainlevy
    cainlevy
    • Tag changed from 2-3-stable, actionmailer, timezone to 2, actionmailer, bugmash-patch, timezone

    December 1st, 2009 @ 10:01 PM

  3. Rohit Arondekar
    Rohit Arondekar
    • State changed from new to stale
    • Importance changed from to

    Marking ticket as stale. If this is still an issue please make a comment with suggested changes, creating a patch with tests, or rebasing an existing patch or just confirming the issue on latest releases/master.

    October 6th, 2010 @ 06:26 AM

  4. Andrea Campi
    Andrea Campi
    • Tag changed from 2, actionmailer, bugmash-patch, timezone to 2-3-stable, actionmailer, bugmash-patch, timezone

    October 16th, 2010 @ 11:37 PM