NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/59951: mailx(1) misparses mbox of git patches



>Number:         59951
>Category:       bin
>Synopsis:       mailx(1) misparses mbox of git patches
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 30 10:55:00 +0000 2026
>Originator:     Valery Ushakov
>Release:        NetBSD 10-stable
>Organization:
>Environment:
NetBSD snips 10.1_STABLE NetBSD 10.1_STABLE (GENERIC) #0: Fri Dec 26 12:48:48 MSK 2025  uwe@tower:/home/uwe/work/netbsd/build-10/obj/macppc/sys/arch/macppc/compile/GENERIC macppc

>Description:
mailx seems to mis-parse a mbox file that is obtained from cat'ting
together several git patches.  mutt correctly parses the same mbox.

>How-To-Repeat:
$ git init
Initialized empty Git repository in /home/uwe/tmp/m/.git/
$ git commit --allow-empty -m 'Initial commit'
[master (root-commit) 83e839c] Initial commit
$ date > a
$ git add a
$ git commit -m 'Add A'
[master 8343b52] Add A
 1 file changed, 1 insertion(+)
 create mode 100644 a
$ date > b
$ git add b
$ git commit -m 'Add B'
[master 521775e] Add B
 1 file changed, 1 insertion(+)
 create mode 100644 b


The `--no-signature` flag in the next command is important.  It
triggers the bug.  (Signatures come with an empty line at the end
that sends mailx down the right path).

$ git format-patch --no-signature HEAD~2..
0001-Add-A.patch
0002-Add-B.patch
$ cat *.patch > mbox
$ grep -B 1 '^From ' mbox 
>From 8343b52966802688ae0a8b8997ad5083ec4ed93c Mon Sep 17 00:00:00 2001
--
+Fri Jan 30 13:39:30 MSK 2026
>From 521775e99fad61935a075af25a3ff68c8eb8fa27 Mon Sep 17 00:00:00 2001
$ mailx -f mbox
Mail version 9.1alpha 2009-02-25.  Type ? for help.
"/home/uwe/tmp/m/mbox": 1 message 1 new
>N  1 uwe%stderr.spb.ru@localhost     Mon Sep 17 00:00  30/750   "[PATCH 1/2] Add A"
& x
$ mutt -f mbox
...
   1 N F Jan 30 Valery Ushakov  (  11) [PATCH 1/2] Add A
   2 N F Jan 30 Valery Ushakov  (  11) [PATCH 2/2] Add B


>Fix:



Home | Main Index | Thread Index | Old Index