Line # Revision Author
1 35 dpavlin #!/usr/bin/perl -w
2
3 # Fix stupd html which is embedded in mailman mbox which you download
4 # this is a filter. Use it like this:
5 #
6 # mailman2mbox.pl < mbox > mbox-new
7 #
8 # 2003-09-04 Dobrica Pavlinusic <dpavlin@rot13.org>
9 #
10
11 my $first = 1;
12
13 while(<STDIN>) {
14 if ($first) {
15 chomp;
16 $first = 0;
17 next if ($_ eq ""); # skip first empty line
18 $_ .= "\n";
19 }
20
21 s,^</*PRE>,,g;
22 s,<A HREF="[^"]*">(.+?)</A>,$1,g;
23
24 # fix quoting
25 s,^&gt;<i>,>,;
26 s,^</I>(&gt;[^<]*)<i>,$1,;
27 s,^</I>,,;
28
29 s/&lt;/</g;
30 s/&gt;/>/g;
31 s/&quot;/"/g;
32 s/&amp;/&/g;
33 s/^(From.+?) at (.+)$/$1\@$2/g;
34 print;
35 }