I am trying to remove an unwanted character >
appearing in the "From "
line in the headers of some old archived emails such as ">From"
and am unable to do so by rewriting the From line using the Procmail recipe
Error reproduced:
>From "xxxx@example.com" Sat Dec 4 11:01:29 2004
Status: RO
From: "xxxxxx" <xxxx@example.com>
Subject: Desktop Alert Utility
To: 'bbbb@example.com'; 'dddd@example.com'
Date: Sat, 04 Dec 2004 05:31:29 +0000
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="--boundary-LibPST-iamunique-1531497257_-_-"
The following does not work:
:0 fhw
| formail -I">From " -a"From "
Even the following does not work:
:0 fhw
| formail -I">From "
What am I doing wrong? Will be happy to share any relevant information.
Note: Due to the unnecessary >
before From
in the first line of the email header, the mail client shows the email as with "No sender" and does not show other details in the summary view. It shows the whole message in the body.
I also tried
LC_ALL=C find . -type f -name ‘*.*’ -exec sed -i '' s/'>From'/'From'/ {} +
but it did not return the result needed.
I am running macOS Mojave.
New note: While my original question is answered below, the extended discussion of applying sed to achieve results have led to a new question at the link below:
Removing unwanted character from the first line of files in a “maildir”