#!/usr/bin/perl use warnings; use strict; # $Id: lyris_filter,v 1.4 2003/10/11 06:16:15 pfeiffer Exp $ # lyris_filter - Kevin Pfeiffer # The LYRIS listserve software apparently breaks the In-Reply-To message # header, meaning that messages no longer thread properly. # Piping messages managed by LYRIS listserve software through this filter # will restore useable In-Reply-To and Message-ID headers for message threading my $end_of_header = 0; # while () { # for testing while (<>) { if ( $end_of_header == 0 ) { $_ =~ s/^Message-ID:\s+/Message-ID: <$1-LYRIS\@$2>/i; $_ =~ s/^In-Reply-To:\s+/In-Reply-To: <$1-LYRIS\@$2>/i; # in case on second line $_ =~ s/^\s+/ <$1-LYRIS\@$2>/i; $end_of_header = 1 if /^$/; } print; }; __END__ # THESE headers (in which the message IDs for _every_ list recipient are slightly different): Message-ID: In-Reply-To: # Are rewritten to: # Message-ID: <2003.10.02-12.48.58-LYRIS@listserver.somewhere.else> # In-Reply-To: <2003.10.02-12.10.54-LYRIS@listserver.itd.umich.edu>