procmail
[Top] [All Lists]

Re: Cleaning up a message

2001-10-25 22:11:25

If what you sent is an example of the body you want to see, you
might use a procmail recipe like:

:0 c
* ^From:(_dot_)*BreakingNews(_at_)CNN(_dot_)COM
* ^Subject:.*CNN Breaking News
| (
        printf "From: BreakingNews(_at_)CNN(_dot_)COM\n" ; \
        printf "To: pageraddress(_at_)provider(_dot_)com\n" ; \
        printf "Subject: News\n\n" ; \
        sed -e '1,/^$/ d' | awk 
'BEGIN{a=0}$1=="--"{a=1}a==1{print}$0~/^$/{nextfile}'
) | $SENDMAIL -t

This would generate a fresh email for your pager whose body consists of
the portion of the body of the CNN message that starts with two dashes
on a line, continuing to the first blank line.

This could certainly be done all in the sed script, but I've had too
many beers this evening to think in punctuation.  Awk is easlier.  :)


On Thu, Oct 25, 2001 at 06:45:19PM -0400, Administrator wrote:

I am currently subscribed to CNN Breaking News and receive an email when
major events happen.  This is great, but I would also like to receive
this message on my pager.  Unfortunatly I am fairly new to procmail and
am not completely certain how to do this.  I know that by executing:

cat <MESSGAE> | grep - | grep -v CNN.com

This works to get only the 1 inportant sentence from the message out,
but I can't exactly figure out how to get procmail to execute this, or
how to then send the cut down message on to my pager which is an email
alias.  I have included the message below because there is probably a
better way to get the information I want out then I have executed.  
Also just for information all messages are formatted the exact same way
with the -- in the front, a very convienent way to pull the important
sentence out.  :)

Thank you in advance for your time and help.

Michael 


BREAKING NEWS from CNN.com

-- "Significant new phase" involving combat forces under way in
Afghanistan, senior administration official tells CNN. Details soon.


Watch CNN or log on to http://CNN.com /AOL Keyword: CNN for the latest
news.
**********************************************************************
Watch CNN for the latest developments as America Strikes Back including
morning updates with Paula Zahn and an in-depth special each weeknight
at 10 p.m. ET with Aaron Brown
**********************************************************************
To unsubscribe from CNN.com's Breaking News E-Mail Alert, log on to:
http://cnn.com/EMAIL/breakingnews.html

Subscribe to CNN.com's daily news overview, weekly political review or
any CNN.com e-mail product at http://CNN.com/email
(c) 2001 Cable News Network, Inc.
An AOL Time Warner Company



CNN Interactive email id:393520070224403

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

-- 
  Paul Chvostek                                             
<paul(_at_)it(_dot_)ca>
  Operations / Development / Abuse / Whatever       vox: +1 416 598-0000
  IT Canada                                            http://www.it.ca/

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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