procmail
[Top] [All Lists]

Re: Modifying the body of emails

2007-07-13 08:03:52
Am 2007-07-06 23:37:08, schrieb LuKreme:
On 6-Jul-2007, at 16:23, Jim Syler wrote:
I am a Procmail and UNIX novice. I have, with much labor, gotten
Procmail up and running and successfully forwarding email the way I
want it to (I'm not using Procmail for an LDA; I'm using it to,
hopefully, filter, modify and redirect email). Now I need some advice
on how to get the actual meat of what I want done working.

Specifically, I want to change certain bits of the body of my emails.
In particular, I want to change things to

     <br><br>--<br><font color="gray" size="2">

Erm, well, first off, <p style="color: gray; font-size:80%"> ... </p>  
would be a much better choice.

But CSS is not supported by all programs.

Posted By  Calion  to  <a
href="http://homepage.mac.com/calion/blog/thoughts/2007/07/here-we-
go.html"> Genius/Idiot&mdash;Current Thoughts </a>  at  7/06/2007
02:10:00 PM</font>

What is the best way to go about doing this?

Probably an external perl script, actually.  the &amp;mdash; problem  
would be easily solved with sed, but multi-line captures and edits  
can be tricky.

A simpel sed call will do it

:0
* tests
* go here
* to ensure right message
{
   :0fwB
   | sed 's/<br><br>--<br>/<p style="color: gray; font-size:80%">/'

This does not wirk because you use
    sed "s///"
so you should use
    sed "s|||"


   :0fwB
   | sed 's/\d:\d\d:\d\d .M/&</p>/'
             ^               ^  ^  ^
              This will never work.

Greetings
    Michelle Konzack
    Systemadministrator
    Tamay Dogan Network
    Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack   Apt. 917                  ICQ #328449886
                   50, rue de Soultz         MSN LinuxMichi
0033/6/61925193    67100 Strasbourg/France   IRC #Debian (irc.icq.com)
____________________________________________________________
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>