title: Using Procmail/Formail/Regex correct an error in email headers
body: <p>I am trying to remove an unwanted character <code>&gt;</code> appearing in the <code>&quot;From &quot;</code> line in the headers of some old archived emails such as <code>&quot;&gt;From&quot;</code> and am unable to do so by rewriting the From line using the Procmail recipe</p>
  <p>Error reproduced:</p>
  <pre><code>&gt;From &quot;xxxx@example.com&quot; Sat Dec  4 11:01:29 2004
  Status: RO
  From: &quot;xxxxxx&quot; &lt;xxxx@example.com&gt;
  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=&quot;--boundary-LibPST-iamunique-1531497257_-_-&quot;
  </code></pre>
  <p>The following does not work:</p>
  <pre><code>:0 fhw
  | formail -I&quot;&gt;From &quot; -a&quot;From &quot;
  </code></pre>
  <p>Even the following does not work:</p>
  <pre><code>:0 fhw
  | formail -I&quot;&gt;From &quot;
  </code></pre>
  <p>What am I doing wrong? Will be happy to share any relevant information.</p>
  <p>Note: Due to the unnecessary <code>&gt;</code> before <code>From</code> in the first line of the email header, the mail client shows the email as with &quot;No sender&quot; and does not show other details in the summary view. It shows the whole message in the body.</p>
  <p>I also tried</p>
  <pre class="lang-sh prettyprint-override"><code>LC_ALL=C find . -type f -name ‘*.*’ -exec sed -i '' s/'&gt;From'/'From'/ {} +
  </code></pre>
  <p>but it did not return the result needed.</p>
  <p>I am running macOS Mojave.</p>
  <hr />
  <p>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:</p>
  <p><a href="https://stackoverflow.com/questions/65730819/removing-unwanted-character-from-the-first-line-of-files-in-a-maildir">Removing unwanted character from the first line of files in a “maildir”</a></p>