mhonarc-users

Re: Suppressing email address in existing archive...

2000-05-10 12:11:49
On Tue 09 May, Dave Sill wrote:
John Beranek <john(_dot_)beranek(_at_)pace(_dot_)co(_dot_)uk> wrote:

Ahem, answered part of my own message...I put <SPAMMODE> in my resource
file, and new messages don't contain the address.

However, this doesn't work for old messages...

Here's a little script I wrote when I was in the same situation. It's
more aggressive than spammode, though, because it cloaks all addresses 
in the file.

  #!/usr/local/bin/perl -pi~
  s|([\!\%\w\.\-+=/]+@)([\w\.\-]+)|$1.('x' x length($2))|ge

Well, thanks for this...just for interest's sake, below is what I came up
with based on this, with the help of a Perl hacker...

I added a bit to the rule so my own email address wouldn't be munged,
cos it appears in the footer of every message in the archive.

The script below basically does <SPAMMODE> AND <NOMAILTO>

========
mungearc
========
#!/usr/local/bin/perl -pi~
# Stop Perl working line-by-line
undef $/;
# Remove mailto URLs (cos we've removed the domains)
s/<A\s+HREF=\"mailto:[\!\%\w\.\-+=\/]+(?<!john.beranek)@[\w\.\-]+\">(mailto:|)([\!\%\w\.\-+=\/]+@)([\w\.\-]+)<\/A>/$2.('x'
 x length($3))/gie;
# Remove the domains
s|([\!\%\w\.\-+=/]+(?<!john.beranek)@)([\w\.\-]+)|$1.('x' x length($2))|gie


$ mungearc *.html

-Dave

John.

P.S. You may note that the 2nd line redoes some of what the first line did,
this was because I was trying to do it all on one line, but gave up.

-- 
John Beranek, Senior Software Engineer
Pace Micro Technology plc. (Cambridge)    Tel: +44 1223 518561
645 Newmarket Road,                       Fax: +44 1223 518526
Cambridge, CB5 8PB, UK.                   Web: http://www.pace.co.uk/