#!/bin/sed -f
# yahoogroups-kill-sig.sed by Aurelio Marinho Jargas
#
# Erases the Yahoo! Groups e-mail signature ad
#
# CHANGELOG:
# 20000??? v0.1 First one
# 20000725 v0.2 Now it has BEGIN/END marks, it's easier!
# 20000906 v0.3 Marks changed
# 20001107 v0.3.1 Contrib: Schlemer HTML killer
# ----- eGroups has changed to Yahoo! Groups -----
# 20010206 v0.4 Contrib: Morcego's s/egroups/yahoo/s fix
# 20010716 v0.5 Marks changed again
# 20030428 v0.6 Policy Terms and Unsubscribe killers included
# 20030506 v0.6.1 One-char fix on the Policy killer, added SAMPLE DATA
#
# DESCRIPTION:
# Yahoogroups.com puts advertises on every sent message to the free groups.
# This file is a sed filter to erase it. It handles quoted '> ' ads also.
# If you do use procmail to filter e-mail messages, use this sed to
# automaticaly remove the Ads for every message you receive.
#
# HOW TO USE:
# Save this file on the disk and put at the begin of your ~/.procmailrc:
# :0 fhw
# * Delivered-To:.*@yahoogroups.com
# | sed -f /path/to/yahoogroups-kill-sig.sed
#
# If preferred, make this file executable (chmod +x), put it in your PATH and:
# :0 fhw
# * Delivered-To:.*@yahoogroups.com
# | yahoogroups-kill-sig.sed
#
#
# SAMPLE DATA FILE:
# You can use this sample data file to test these rules "by hand",
# before including them on the procmail file.
# Save the following fake e-mail message on a 'data.txt' file
# (remove the leading # chars!) and run:
#
# prompt$ sed -f yahoogroups-kill-sig.sed data.txt
#
# All the Ads and Yahoo! messages should be removed.
#
#---------------------------8<---------------------------
#From: foo@foo.com
#To: foo@foo.com
#Subject: test me
#
#Here's the message body.
#And now, the evil sig.
#
#------------------------ Yahoo! Groups Sponsor ---------------------~-->
#Secure your servers with 128-bit SSL encryption! Grab your copy of
#VeriSign's FREE Guide "Securing Your Web Site for Business." Get it now!
#http://www.verisign.com/cgi-bin/go.cgi?a=n094442340008000
#http://us.click.yahoo.com/6lIgYB/IWxCAA/yigFAA/dkFolB/TM
#---------------------------------------------------------------------~->
#
#Your use of Yahoo! Groups is subject to
#http://docs.yahoo.com/info/terms/
#
#To unsubscribe from this group, send an email to:
#foo-unsubscribe@yahoogroups.com
#--------------------------->8---------------------------
#-------------------------------------------------------------------------
# +----+
# | Ad |
# +----+
#
# Ad details: * a line w/ 24 hifens, 'Yahoo...Sponsor', 21 hifens and '~-->'
# * lines with yahoogroups propaganda
# * a line with 69 hifens, and '~->' at the end
# Ad Sample:
# ------------------------ Yahoo! Groups Sponsor ---------------------~-->
# Secure your servers with 128-bit SSL encryption! Grab your copy of
# VeriSign's FREE Guide "Securing Your Web Site for Business." Get it now!
# http://www.verisign.com/cgi-bin/go.cgi?a=n094442340008000
# http://us.click.yahoo.com/6lIgYB/IWxCAA/yigFAA/dkFolB/TM
# ---------------------------------------------------------------------~->
#
# Ad Killer:
/^\(> \)*-\{24\} Yahoo! Groups Sponsor -\{21\}~-->$/,/^\(> \)*-\{69\}~->$/ d
#-------------------------------------------------------------------------
# +--------+
# | Policy |
# +--------+
#
# You can also remove the Policy Terms message.
#
# Policy Details: A one line message, sometimes broken into two,
# which appears at the very end of the message.
# Policy Sample:
# Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
#
# Policy Killer:
/^\(> \)*Your use of Yahoo! Groups is subject to *$/ N
/^\(> \)*Your use of Yahoo! Groups is subject to/ d
#-------------------------------------------------------------------------
# +-------------+
# | Unsubscribe |
# +-------------+
#
# This one is to remove the *default* unsubscribe footer.
#
# Unsubscribe Details: A one line message, sometimes broken into two,
# which appears before the Ads.
# Unsubscribe Sample:
# To unsubscribe from this group, send an email to:
# foo-unsubscribe@yahoogroups.com
#
# Unsubscribe Killer:
/^\(> \)*To unsubscribe from this group, send an email to: *$/ N
/^\(> \)*To unsubscribe from this group, send an email to:/ d
#-------------------------------------------------------------------------
# +---------+
# | Ad HTML |
# +---------+
#
# For those who receive the Yahoo! messages in HTML (argh!), you may use
# this one also, because the HTML signature is way different.
#
# Ad Details: * an HTML comment with bar-star-star-bar,text,bar-star-star-bar
# * lines with egroups propaganda
# * an HTML comment with bar-star-star-bar,text,bar-star-star-bar
# Ad Sample:
# <!-- |**|begin egp html banner|**| -->
#
# <hr>
# <!-- |@|begin eGroups banner|@| runid: 8193 crid: 4101 -->
# <a target=3D"_blank"
# href=3D"http://click.egroups.com/1/8193/8/_/134812/_/9=
# 66089206/"><center>
# <img width=3D"468" height=3D"60"
# border=3D"0"
# alt=3D""
# src=3D"http://adimg.egroups.com/img/8193/8/_/134812/_/966089206/468x60_ma=
# ze12k.gif"></center><center><font color=3D"black"></font></center></a>
# <!-- |@|end eGroups banner|@| -->
# <hr>
#
# <!-- |**|end egp html banner|**| -->
#
# Ad Killer:
#/^\(> \)*<!-- |\*\*|begin egp html banner|\*\*| -->$/,/^\(> \)*<!-- |\*\*|end egp html banner|\*\*| -->$/d
#-------------------------------------------------------------------------
# +-------------+
# | OLD KILLERS |
# +-------------+
#-------------------------------------------------------------------------
#
# +---------+
# | Ad v0.4 |
# +---------+
#
# Ad details: * a line w/ 24 hifens, 'Yahoo!...Sponsor', 21 hifens and '~-~>'
# * lines with yahoogroups propaganda
# * a line with 69 hifens, and '_->' at the end
# Ad Sample:
# ------------------------ Yahoo! Groups Sponsor ---------------------~-~>
# eGroups is now Yahoo! Groups
# Click here for more details
# http://click.egroups.com/1/11231/1/_/161736/_/980877852/
# ---------------------------------------------------------------------_->
#
# Ad Killer:
#/^\(> \)*-\{24\} Yahoo! Groups Sponsor -\{21\}~-~>$/,/^\(> \)*-\{69\}_->$/d'
#
#-------------------------------------------------------------------------
#
# +---------+
# | Ad v0.3 |
# +---------+
#
# Ad details: * a line w/ 26 hifens, 'eGroups Sponsor', 25 hifens and '~-~>'
# * lines with egroups propaganda
# * a line with 69 hifens, and '_->' at the end
#
# Ad Sample:
# -------------------------- eGroups Sponsor -------------------------~-~>
# GET A NEXTCARD VISA, in 30 seconds! Get rates
# of 2.9% Intro or 9.9% Ongoing APR* and no annual fee!
# Apply NOW!
# http://click.egroups.com/1/7872/14/_/_/_/967638075/
# ---------------------------------------------------------------------_->
#
# Ad Killer:
#/^\(> \)*-\{26\} eGroups Sponsor -\{25\}~-~>$/,/^\(> \)*-\{69\}_->$/d
#
#-------------------------------------------------------------------------
#
# +---------+
# | Ad v0.2 |
# +---------+
#
# Ad details: * a line with 68 hifens, an '<e|' and another hifen
# * lines with egroups propaganda
# * a line with 68 hifens, an '|e>' and another hifen
# Ad Sample:
# --------------------------------------------------------------------<e|-
# Huge Shoe Selection at Zappos.com
# (small sizes also available)
# http://click.egroups.com/1/7062/5/_/193628/_/964577029/
# --------------------------------------------------------------------|e>-
#
# Ad Killer:
#/^\(> \)*-\{68\}<e|-$/,/^\(> \)*-\{68\}|e>-$/d
#
#-------------------------------------------------------------------------
#
# +---------+
# | Ad v0.1 |
# +---------+
#
# Ad Details: * a line with exactly 72 hifens before and after
# * any number of lines between
# * a line with 'http://click.egroups.com'
# Ad Sample:
# ------------------------------------------------------------------------
# $60 in FREE Long Distance! Click Here to join beMANY! today.
# http://click.egroups.com/1/4126/10/_/_/_/958599956/
# ------------------------------------------------------------------------
#
# Ad Killer:
#/^\(> \)*-\{72\}$/{N;:l;/-\{72\}$/bs;N;bl;:s;s%^.*\n\(> \)*http://click\.egroups\.com.*%%;}
### colorized by sedsed, a debugger and code formatter for sed scripts
### original script: http://aurelio.net/sed/programas/yahoogroups-kill-sig.sed