[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Messages change when I inc and then packf
From: |
Ralph Corderoy |
Subject: |
Re: Messages change when I inc and then packf |
Date: |
Sat, 25 Jul 2020 14:01:38 +0100 |
Dea kat,
Thanks for the detailed report.
Re-ordering the samples, we have the start of the mbox,
> From
> bounces+02f28c80-742a-11ea-bdd3-525400f0258a_VS2CRM@sender2.zohocrm.com Thu
> Jul 23 18:14:07 2020
> Return-Path:
> <bounces+02f28c80-742a-11ea-bdd3-525400f0258a_VS2CRM@sender2.zohocrm.com>
which inc(1) turns into
> Return-Path:
> <bounces+02f28c80-742a-11ea-bdd3-525400f0258a_VS2CRM@sender2.zohocrm.com>
packf(1)-ing that gives
> From Fri Jul 24 07:52:09 2020
> <bounces+02f28c80-742a-11ea-bdd3-525400f0258a_VS2CRM@sender2.zohocrm.com>
and inc-ing that broken mbox just adds more breakage:
>
> <bounces+02f28c80-742a-11ea-bdd3-525400f0258a_VS2CRM@sender2.zohocrm.com>
I think the problem is packf(1) assumes the Return-Path field will all
be on one line.
if (has_prefix(buffer, "Return-Path:")) {
char tmpbuffer[sizeof buffer];
char *tp, *ep, *fp;
strncpy(tmpbuffer, buffer, sizeof(tmpbuffer));
ep = tmpbuffer + 13;
if (!(fp = strchr(ep + 1, ' ')))
fp = strchr(ep + 1, '\n');
tp = dctime(dlocaltimenow());
snprintf (buffer, sizeof(buffer), "From %.*s %s",
(int)(fp - ep), ep, tp);
I can re-produce the problem.
$ packf -version
packf -- nmh-1.7+dev 1.7-branchpoint-573-g248c3a45-dirty built 2019-12-09
13:02:37 +0000 on orac
$ printf '%s\n' 'Return-Path:' ' <foo@example.com>' >1
$ sed -n l 1
Return-Path:$
<foo@example.com>$
$ packf
Create file "/home/tmp/1595681193.773389990/msgbox"? yes
$ sed -n l msgbox
From Sat Jul 25 13:47:55 2020$
<foo@example.com>$
$
--
Cheers, Ralph.