On Fri, Oct 26, 2001 at 01:18:32PM -0400, David T-G wrote: > % > % First of all, I'd like to see the hostname portion of the Message-ID in > ... > % way to do this. I guess I could set up a procmail recipe to put it in > % the subject or something, but that seems rather ugly. > > Yes, it does; I'd think that poking at the From: header would be better. > In either case, though, I don't know how you'd display in the index from > the MessageID.
I got this working using Simon Cozens' Mail::Audit perl module: http://simon-cozens.org/writings/mail-audit.html It's a great replacement for procmail. It's very easy to extract the hostname from the Message-Id but took a trick to rewrite the From: header. #!/usr/bin/perl require Mail::Audit; my $mail = Mail::Audit->new; my $from = $mail->from(); my $header = $mail->header(); if ($from =~ /root\@/) { $header =~ /Message-Id: \<.*\@(.*)\..*\..*\>/; $mail->put_header("From-orig:", "$from"); $mail->{obj}->head->replace("From:", "root\@$1"); #see Mail::Internet $mail->accept(); } The trick is to reach around Mail::Audit to its parent, Mail::Internet, to rewrite the From: header. And I saved the original From: header in a new From-orig: header line. -- Dave