procmail
[Top] [All Lists]

Philip and Timo, thanks for your help!

2000-12-21 14:28:47
Philip and Timo,

Thanks for all of your help! (Via the comp.mail.misc Usenet Group)

Here is what I cam up with (and it works!)

filename = $HOME/www/htdocs/cusd-today.txt
:0 bw : $filename.LOCKEXT
*^From:(_dot_)*(_at_)k12(_dot_)com*
*^Subject:.*k12 Daily News*
| perl -p -e 's/old-text/new-text/gi' | \
tee $filename | \
mail -s "CUSD - k12 Daily News" 
distro-list(_at_)chandler(_dot_)k12(_dot_)az(_dot_)us -f
basilr(_at_)chandler(_dot_)k12(_dot_)az(_dot_)us

What I do with this is take a daily k12 newsletter, and then re-write part
of the message and then re-distribute it to our district via email. I also
save a copy of it on our webserver (and call it via an SSI page) for those
that do not have an email account.

Next projects for the code:

#1 Add a header to the outgoing message. I guess I would have to use formail
to do this, I don't think "mail" can do it? I have been looking for a good
formail primer but can't seem to find one The man pages are not helping me
very much, any hints?

#2 I also need to read up on my regexp's to help search and replace more of
the newsletter. I want to delete this out of the newsletter:

.....
you are subscribed as basilr(_at_)chandler(_dot_)k12(_dot_)az(_dot_)us
to unsubscribe send a blank email to unsubscribe-282973V(_at_)k12(_dot_)com
.....

The reason why I want to delete part of the newsletter is because I don't
want the people that I send the newsletter on-to to try and delete me from
the original newsletter list. You would be surprised what some of our
teachers try and do when they don't understand something. :)

I have tried:

perl -p -e 's/.....*.....//gi'

But that does not seem to work.

Thanks again!



Robert Basil
Chandler Unified School District

_______________________________________________
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>
  • Philip and Timo, thanks for your help!, Gun Wear <=