procmail
[Top] [All Lists]

Re: How to avoid s/\n/ /g when unfolding a header

2004-12-13 14:12:36
On Tue, Dec 14, 2004 at 08:32:43AM +1300, Volker Kuhlmann wrote:
   sed "s/$NL//g"

Test this on your box first - newline handling in sed wasn't all that
portable.

However, I'd probably do the whole thing in tr (if I didn't use the
recursive INCLUDERC):

  av_SUBJECT = `formail -zx Subject | tr -d "[$WS$NL]"

Ehh, no. You can use tr -d to strip newlines, though to unfold
header lines you'd want to convert them into spaces (after stripping
leading white space). You can't use tr -d to remove white space as it
will makeyoursubject:looklikethis.

Yes, I realize.  But the OP was interested in a limited use of
this for base64-encoded or quoted-printable subject lines that
are broken across lines on purpose to obfuscate what they say.
These particular subjects would all be sans whitespace in their
"natural" state.  At least, that was my understanding of what he
was trying to do.


Btw your ideas on how to do things in procmail are often intrigueing...
and very useful. Thanks!

You're welcome.

-- 
dman

____________________________________________________________
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