From 2ab2660fbc8636a71fcfb01766672308c60915d4 Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Sun, 18 Aug 2013 13:07:51 -0400 Subject: [PATCH] First hack on a mailman archive script. Mailman archives tend to "hide" email addresses in the /^From/ line, making them invalid mboxes. This fixes it. --- mailman-archive-create-real-mbox.plx | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 mailman-archive-create-real-mbox.plx diff --git a/mailman-archive-create-real-mbox.plx b/mailman-archive-create-real-mbox.plx new file mode 100755 index 0000000..bbe5a76 --- /dev/null +++ b/mailman-archive-create-real-mbox.plx @@ -0,0 +1,37 @@ +#!/usr/bin/perl -w +# mailman-archive-create-real-mbox.plx -*- Perl -*- + +# Copyright (C) 2013 Bradley M. Kuhn +# +# This software's license gives you freedom; you can copy, convey, +# propogate, redistribute and/or modify this program under the terms of +# the GNU General Public License (GPL) as published by the Free +# Software Foundation (FSF), either version 3 of the License, or (at your +# option) any later version of the GPL published by the FSF. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program in a file in the toplevel directory called +# "GPLv3". If not, see . + +use strict; +use warnings; + +while (<>) { + if (/^From\s+(\S+)\s+at\s+(\S+)\s+(.+)$/) { + print "From ${1}\@${2} ${3}\n"; + } elsif (/^From\s+/) { + die "invalid from line $_"; + } else { + print $_; + } +} + +# +# Local variables: +# compile-command: "perl -c mailman-archive-create-real-mbox.plx" +# End: