Package: maildrop
Version: 2.9.3-2+b1
Severity: normal
Tags: upstream

Dear Maintainer,

reformime -r8 corrupts UTC date in mbox From line.

I have a test message in quoted-printable format:

$ cat test.msg | reformime -i
section: 1
content-type: text/plain
content-transfer-encoding: quoted-printable
charset: UTF-8
starting-pos: 0
starting-pos-body: 1778
ending-pos: 3238
line-count: 67
body-line-count: 29

It is in mbox format. Here is its first line:

$ cat test.msg | head -1
>From [email protected] Mon Mar 01 00:02:22 2021

Processing with reformime -r8 corrupts the UTC date:

$ cat test.msg | reformime -r8 | head -1
>From [email protected] Mon Mar 01 00: 02:22 2021

When piping such a message to exim in my procmailrc I was getting
undesirable behavior (the message was sent but embedded in a new message)
which led me into the deep dive to identify the problem.

Note: everything else about the behavior of reformime seems correct:
$ cat test.msg | reformime -r8 | reformime -i
section: 1
content-type: text/plain
content-transfer-encoding: 7bit
charset: utf-8
starting-pos: 0
starting-pos-body: 1867
ending-pos: 3269
line-count: 55
body-line-count: 15

I find nothing else wrong with the output.

I downloaded and compiled reformime in version 3.0.7 of maildrop. It
behaves in the same way corrupting way.

I was able to work around the problem with this:

$ cat test.msg | reformime -r8 | sed -e '1s/: \([0-9]\)/:\1/' | head -1
>From [email protected] Mon Mar 01 00:02:22 2021

Note: Appendix A of RFC4155 specifies that mailbox formatted messages
should include UTC formatted dates. See
https://datatracker.ietf.org/doc/html/rfc4155#appendix-A

-- System Information:
Debian Release: 11.2
  APT prefers stable-security
  APT policy: (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-11-amd64 (SMP w/6 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages maildrop depends on:
ii  courier-authlib      0.71.1-2
ii  libc6                2.31-13+deb11u2
ii  libcourier-unicode4  2.1.2-2
ii  libgcc-s1 [libgcc1]  10.2.1-6
ii  libgcc1              1:8.3.0-6
ii  libgdbm6             1.19-2
ii  libpcre3             2:8.39-13
ii  libstdc++6           10.2.1-6

Versions of packages maildrop recommends:
ii  exim4-daemon-heavy [mail-transport-agent]  4.94.2-7

maildrop suggests no packages.

-- no debconf information

Reply via email to