[Fwd: Modifying the sender]

Harmanjit Singh <[email protected]> Fri, 06 Jun 2008 06:25:48 +0530
Newsgroups gmane.comp.lang.perl.modules.mail-box
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------080102060409010002090701
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi Mark,

Thanks for a great package!

Not sure if the mailing list is still active.  I have a query, which is 
attached.

I will appreciate any help!

Regards,
Harman.

--------------080102060409010002090701
Content-Type: message/rfc822;
 name="Modifying the sender.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="Modifying the sender.eml"

X-Mozilla-Keys: 
Message-ID: <[email protected]>
Date: Thu, 05 Jun 2008 18:21:56 +0530
From: Harmanjit Singh <[email protected]>
User-Agent: Thunderbird 2.0.0.14 (Windows/20080421)
MIME-Version: 1.0
To: [email protected]
Subject: Modifying the sender
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

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.


--------------080102060409010002090701
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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

--------------080102060409010002090701--