procmail
[Top] [All Lists]

Looking inside MIME (was Re: State of procmail)

2016-08-20 22:14:56
John Levine wrote:

I do not understand the problem.   The mime headers are plain-text, there is
no problem regarding to procmail recipes.

It would be nice if procmail's regexes could match the text inside
MIME-encoded headers.  And it would also be nice if there were some
way to tell it to look for particular kinds of body parts and look
inside the contents.

Procmail needs some help, but it is easily doable:

  (In the recipe below $atext is as defined in RFC5322 section 3.2.3.)

  :0
  * SUBJECT ?? =(20[$atext]+|\?ISO-8859-1)
  {
    SUBJECT=`echo "$MATCH" | mimencode -u -b`

    :0 hfw
    | formail -i "Subject: $SUBJECT"
  }

Using mimencode is a little heavyweight, but processor is a lot
cheaper than it used to be ...

Reto
--
R A Lichtensteiger      rali(_at_)tifosi(_dot_)com

   "I am truly in awe how deeply the implications and alternatives have
    been analysed.  This is particularly impressive given the complete
    absence of any facts about the alleged proposal."  -- Randy Bush on NANOG
____________________________________________________________
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