/[perl]/mailman2mbox.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /mailman2mbox.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations)
Mon Mar 1 16:53:07 2004 UTC (15 years, 4 months ago) by dpavlin
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/plain
fix broken MailMan archive download format to correct mbox format
(seems to be issue only with older mailman installations, but they
are still often)

1 dpavlin 1.1 #!/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     }

  ViewVC Help
Powered by ViewVC 1.1.26