procmail
[Top] [All Lists]

Re: Some strange is done to subject line

2009-10-29 20:51:00
At 21:47 2009-10-29 +0100, Michelle Konzack wrote:

   MSG_SUBJECT=`mimedecode |formail -czx Subject:`
    :0
    * ? echo "${MSG_SUBJECT}" |grep "Retrospect"
    .Retrospect.in

Wow, pipe the entire message out to mimedecode and THEN to formail to grab the subject? Then use echo and grep in the comparisong condition?

The encoded bit is inside the subject header. No need to decode the rest of the message.

I won't claim that the subject decoder I posted is the most efficient possible, but you won't get hit with a shell invocation unless the subject is encoded, and the subseqent comparison operations are a lot lighter as well.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

____________________________________________________________
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

<Prev in Thread] Current Thread [Next in Thread>