procmail
[Top] [All Lists]

Re: Transform part of a message body

2016-01-18 02:29:11


On 17/01/16 16:19, udi M wrote:


On 17/01/16 15:02, @lbutlr wrote:
On Jan 17, 2016, at 5:19 AM, udi M <uuddii(_at_)eng(_dot_)tau(_dot_)ac(_dot_)il> wrote:



On 17/01/16 09:33, @lbutlr wrote:
I get some emails sometimes that have a long line of characters, usually used to mark a huge set of footers

Something like

============================
Text goes here

(or maybe -’s *’s or other characters.

I’d like to modify a message with, say, a line of 10 or more repeated characters and change that line to be a signature delimiter.

What do you mean "signature delimiter” ?
<https://en.wikipedia.org/wiki/Signature_block#Signature_dashes>

As can be seen in all my messages.

    I could not check it now but, you can try,  find line with more then three "="s
    "^[ =]+===[= ]+$"  and then count the "="s  from the MATCHed:

* 15^0
     Correction, not plus 15, it is minus 15:
*  -15^0
1^1  MATCH  ??  =

    If found  pipe it to sed:

| sed s/$MATCH/-- /

    Do the same with "-"s and "*"s  or change the REGX to  [=*-]

    One of the problems start if somebody use ascii-art to explain you somthing
    and will write lines like this.

    If you don't care performance use the sed to figure-out instea of procmail:

  sed  "s/^[ ]*=\{15,\}[ ]*$/-- /"

--Udi



vv right here



____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail