Github messages for voidlinux
 help / color / mirror / Atom feed
From: ffobzb <ffobzb@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [ISSUE] opensmtpd: Does not respect the system time zone in mail header and logfile
Date: Wed, 12 Oct 2022 21:48:40 +0200	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-39918@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 3166 bytes --]

New issue by ffobzb on void-packages repository

https://github.com/void-linux/void-packages/issues/39918

Description:
### Is this a new report?

Yes

### System Info

Void 4.9.261_1 x86_64 glibc

### Package(s) Affected

opensmtpd-6.8.0p2_4

### Does a report exist for this bug with the project's home (upstream) and/or another distro?

_No response_

### Expected behaviour

In the headers of the tranferred mail and in the logfiles the MTA should use times with the time zone which was set up for this system.

### Actual behaviour

OpenSMTPD seems to write times in UTC instead of my system time zone (Europe/Berlin, actually UTC+2).
Example header from a local delivered mail:
```
From abc  Wed Sep 28 21:09:55 2022  
Return-Path: <webmaster@yourdomain.com>  
Delivered-To: abc@localhost  
Received: from localhost (xyz.localdomain [local])  
        by xyz.localdomain (OpenSMTPD) with ESMTPA id 020e7525  
        for <abc@localhost>;  
        Wed, 28 Sep 2022 19:09:55 +0000 (UTC)  
Date: Wed, 28 Sep 2022 21:09:55 +0200 (CEST)  
To: abc@localhost  
From: webmaster@yourdomain.com  
Subject: Test Email  
Message-ID: <b4b222b031806af8@xyz.localdomain>  
```

In the "Date" header the local time in the correct time zone is used. In the "Received" header which is added by OpenSMTPD the time is stated in UTC, regardless of the time zone of the system.

The same problem exists for the log file (/var/log/socklog/mail/current): 
```
2022-09-28T19:09:10.78118 mail.info: Sep 28 21:09:10 smtpd[2699]: info: OpenSMTPD 6.8.0p2 starting
2022-09-28T19:09:55.62957 mail.info: Sep 28 21:09:55 smtpd[2703]: b4b222afa5939ddc smtp connected address=local host=xyz.localdomain
2022-09-28T19:09:55.63338 mail.info: Sep 28 19:09:55 smtpd[2703]: b4b222afa5939ddc smtp message msgid=020e7525 size=389 nrcpt=1 proto=ESMTP
2022-09-28T19:09:55.63342 mail.info: Sep 28 19:09:55 smtpd[2703]: b4b222afa5939ddc smtp envelope evpid=020e752572255a45 from=<webmaster@yourdomain.com> to=<abc@localhost>
2022-09-28T19:09:55.63347 mail.info: Sep 28 19:09:55 smtpd[2703]: b4b222afa5939ddc smtp disconnected reason=quit
2022-09-28T19:09:57.64998 mail.info: Sep 28 19:09:57 smtpd[2703]: b4b222b1cbdebff4 mda delivery evpid=020e752572255a45 from=<webmaster@yourdomain.com> to=<abc@localhost> rcpt=<abc@localhost> user=abc delay=2s result=Ok stat=Delivered
2022-09-28T19:11:20.45865 mail.info: Sep 28 21:11:20 smtpd[2699]: Exiting
```

When the OpenSMTPD process starts it logs with the local time (21:09:10). When processing mails it changes over to UTC (19:09:55). And when it exits it uses local time again (21:11:20). I don't think that this behaviour is intended.

Maybe the _smtpd or the _smtpq user to which OpenSMTPD drops privileges is not able to read the setted up time zone? Therefore this problem is maybe Void specific, since I haven't found any bug reports from other distributions or from OpenBSD regarding this.


### Steps to reproduce

1. Start opensmtpd
2. Send a local mail to yourself on the system
3. Check the mail headers for the time zone in the "Received" header
4. Check `/var/log/socklog/mail/current` for the logged times


             reply	other threads:[~2022-10-12 19:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-12 19:48 ffobzb [this message]
2022-11-04 15:02 ` sdgathman
2022-11-04 15:07 ` sdgathman
2022-11-04 15:17 ` sdgathman
2022-11-04 15:19 ` sdgathman
2022-11-04 16:37 ` sdgathman
2022-11-07 20:25 ` ffobzb
2023-05-01 15:58 ` vmc-coding
2023-05-01 15:59 ` vmc-coding
2023-05-01 15:59 ` vmc-coding
2024-02-27 20:39 ` ffobzb
2024-02-27 20:41 ` ffobzb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-39918@inbox.vuxu.org \
    --to=ffobzb@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).