Hello Andrea.

a.bia...@tiscali.it wrote in
 <20211107160254.7e37b12a@alice.paese.meraviglie>:
 |On Sun, 07 Nov 2021 03:24:09 +0100, Steffen Nurpmeso
 |<stef...@sdaoden.eu> wrote:
 |> Steffen Nurpmeso wrote in
 |>  <20211105195037.kis5f%stef...@sdaoden.eu>:
 |>|a.bia...@tiscali.it wrote in
 |>| <20211105160443.514b1f69@alice.paese.meraviglie>:
 |>| ...
 |>||Minimal code to reproduce the issue:
 |>||
 |>||root@darkstar:~# rm -f ~/dead.letter && TZ=Europe/Dublin mailx -S
 |>||mta=no-thank-you root < /dev/null; cat ~/dead.letter
 |>   ...
 |> I went tm_gmtoff to use it if available.
 |> I will look in more detail on Monday, it is .. very late.
 |> The .tm_gmtoff usage is not yet correct.
 |> 
 |> However, this will be in v14.9.23 that will be release in about
 |> two weeks, thanks again for reporting this issue, Andrea!
 |> (You may then do "TZ=Europe/Dublin mailx -Smta=test X </dev/null".)
 |
 |You can mention my name, no problem. I was about to put together a

Great.

 |patch for myself and share it upstream because that's the Slackware
 |way :)
 |
 |tm_gmtoff seems like the easiest way. If you're interested in
 |portability, the only *portable* way of finding the offset from UTC
 |that I've found is:
 |
 |   struct tm l,g;
 |   g = *gmtime(&t);
 |   l = *localtime(&t);
 |
 |and work out the difference between g and l by checking the members
 |(e.g. normalizing to either number of minutes) with something like:
 |
 |  diff = (l->tm_sec-g->tm_sec)/60
 |  +(l->tm_min-g->tm_min)
 |  +(l->tm_hour-g->tm_hour)*60
 |  /* + compensate for day/month/year difference */
 |
 |I'm happy to put some code together if you want. Or test a patch, if you
 |prefer.

That day-of-year / dateborder approach as is used by all other
MUAs was a great hint, thank you, Andrea!
Yes i did it like that as a fallback if tm_gmtoff is not
available, and from some testing it works fine.

Thanks again for this report, and also the hint.
Let's see whether i can release this week.

Ciao from Germany!

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

Reply via email to