Modifying the sender

Harmanjit Singh <[email protected]> Thu, 05 Jun 2008 18:21:56 +0530
Newsgroups gmane.comp.lang.perl.modules.mail-box
Message-ID <[email protected]>
Hi All,

Please excuse me if this is a simple question, but I haven't been able 
to find out the solution from the documentation.

I am trying to anonymize a large archive of messages, to be then 
processed by hypermail.  I have a table for mapping sender email 
addresses to numbers (e.g. Respondent 1).

I read messages one by one from an mbox and want to modify its primary 
sender to "$name" <$email> and then write it out (preferably to the same 
mbox that I am reading from, or if not, then to another mbox).

I don't care much about the Received headers being consistent etc. with 
the original sender, hypermail doesn't use those headers.

Is it possible?  What is the easiest way to go about it?

The following obviously doesn't work:

my $folder = $mgr->open($ARGV[1], access => 'rw');
foreach my $message ($folder->messages)
{
     if (defined $message->sender)
     {
	$new_sender = Mail::Address->new('Name', 'user@domain');
	$message->sender = $new_sender;
     }
}


Thanks for your help,
Harman.

_______________________________________________
Mailbox mailing list
[email protected]
http://lists.utsl.gen.nz/mailman/listinfo.cgi/mailbox