On 28.02.18 12:10, Patrick Shanahan wrote:
> some time ago, in an earlier age, Sven Guckes posted a sed or perl filter
> to hide "Subject:" additions, but I seem to have lost it, and he seems to
> be missing too  :^(
> 

The following has served for so many years in my .procmailrc that I
can't recall if it was Sven who provided the method for _stripping_ that
cruft from the incoming subject header.

   :0
   * ^TO_luv-main@.*luv.asn.au
   {
                        # We need the subject line _content_, minus [list-name]:

      SUBJECT=`formail -czX "Subject:" | sed -re "s/Subject:// ; s/ 
\[luv-[a-z]*\]//g"`
   
                        # Header filter leaves body alone:
      :0fhw
      | formail -i "Subject: $SUBJECT"
   
                        # Delivery, with lockfile:
      :0:
      luv-main
   }

The second sed regex could perhaps be generalised, rather than just
retargeted for your problem list, but a quick fix is a good fix, so
long as it does the job, I figure.

Changing "-i" to -I" on line 10 stops the received subject header being
retained as "Old-Subject:", but retaining it is a reminder that the post
has been trivially munged.

The ^TO_ on line 2 accepts either "To:" or "Cc:", as adjunct to simple
duplicates management via formail. (Forces "courtesy copy" to the list
mailbox.)

Erik

Reply via email to