procmail
[Top] [All Lists]

removing egroups ad (was: Re: reciept needed)

2000-09-04 06:59:46
ztrader wrote:

MD> Ugh.  I guess egroups changed again.

My guess is that they will continue to make small (and possibly large)
changes frequently to foil simple attempts at removing ads. Is there a
way to get more adaptive in recognizing the ad?

It's at the top of the message.

It being placed at the top is recent (it was at the bottom) but I'm
assuming it will now stay at the top, where it's more obtrusive.

Without worrying about many other minor formatting changes they
might make, the following should remove the ad, which I'm defining
as the first "paragraph" whenever it mentions "click.egroups.com".
(This is likely to be more general than the others posted since
it doesn't depend on formatting details; however, it won't handle
any ads-at-the-bottom saved old mails you might have)

Note, you should make sure that you can actually pass 500000-byte
arguments to "echo"; if not, reduce this number below.  Mails too
large will retain the ad (but that will be the least of your
problems :-)

[For my own use, I add another condition, that it's been sent to me
(based on the return path) so I won't process egroups mail "bounced" to
me by someone else, but that's just a personal preference.]

Adding the X-Ad-Removed: header is optional, but is there in case
I ever forget where the ad went  :-)

Any ideas, and code, much appreciated.

Hope this is of some use,
Stan
===== cut here =====
LINEBUF=500000

:0
* ^X-eGroups-Return: 
* ^List-Unsubscribe:(_dot_)*-unsubscribe(_at_)egroups\(_dot_)com
* $ < $LINEBUF
{ }

:0a
{ 
    # remove first paragraph if contains "...click.egroups.com..."
    :0bBfwi
    * ^^(.+($))*(.+click\.egroups\.com.+($))(.+($))*($)\/(.*($))+
    | echo "$MATCH"

    :0hHfwi
    |formail -A "X-Ad-Removed: yes"
}
#... continue with your "regular" processing from here...

_______________________________________________
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>