bugGNU Mailutils - Bugs: bug #61239, Timezone offset in date header...


bug #61239: Timezone offset in date header weirdness when sendmail mail

Submitter:  None
Submitted:  Tue 28 Sep 2021 07:43:03 PM UTC
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  gray
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup

Thu 08 Feb 2024 06:41:34 AM UTC, comment #2: 

I think there might still be an issue here - in particular with time zones above UTC+12. I'm currently in NZDT (UTC+13) and I've noticed that all the emails that are sent with the 'mail' command have the time zone in the 'Date' header set to -1100. I think the issue is with the 'else if (d > SECS_PER_DAY/2)' line since this will always be true for time zone offsets above UTC+12 and so it subtracts SECS_PER_DAY making my UTC+13 become UTC-11.

Thu 30 Sep 2021 04:23:42 AM UTC, comment #1: 
Sergey Poznyakoff <gray>
Group administrator
Tue 28 Sep 2021 07:43:03 PM UTC, original submission:  

The introduction of message_add_date in GNU Mailutils 3.13, may lead to weirdness in the timezone offset in Date headers added when sending messages (eg "Date: Sat, 7 Aug 2021 23:00:01 +4400"). I believe the problem arises in mu_utc_offset() in libmailutils/datetime/utcoff.c when the day (or month or year) of the GMT date differs from that of the localtime date.

For example, consider a message being sent at 2005 EDT / 0005 UTC. In mu_utc_offset, TMSEC(&ltm) equals 72300 and TMSEC(&gtm) equals  300. Initially, d is assigned 72000. But since ltm.tm_mday does not equal gtm.tm_mday, the function adds a day's worth of seconds to it and returns 158400. And in turn, mu_c_streamftime() generates the timezone offset in the date header by converting that to hours (44 = 158400/(60*60)) and minutes (0 = (158400/60)%60).



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by gray (Posted a comment)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-09-30 gray StatusNone Fixed
        Assigned toNone gray

    Back to the top

    Powered by Savane 3.13-b921.
    Corresponding source code