Archive for June, 2006

Stripping and replacing email headers

Thursday, June 22nd, 2006

The Perl CPAN module Mail::MboxParser does a great job at stripping and replacing email headers.
Say you have your email message (with headers) in a string variable $msg_str. Now check this

use Mail::MboxParser;

my $mail = Mail::MboxParser::Mail->new($msg_str);
my $mail_new = $mail->make_convertable();
$mail_new->delete_from_header(’received’);
$mail_new->replace_in_header(’to’, ‘new_to@domain.com’);
$mail_new->replace_in_header(’from’, ‘new_from@domain.com’);
$mail_new->send(’sendmail’);

The above code strips all the Received headers and replaces the To and From headers. It even […]

Pearl Jam

Thursday, June 22nd, 2006

Bought Pearl Jam’s latest self-titled album, and its superb.
Taste these lyrics
Life Wasted
You’re always saying you’re too weak to be strong,…
You’re harder on yourself than just about anyone
I have faced it,… A life wasted,…
I’m never going back again.
Oh I escaped it,… A life wasted,…
I’m never going back again.
Having tasted,… A life wasted,…
I’m never going back again.
Oh […]


Tweet This Post links powered by Tweet This v1.4.1, a WordPress plugin for Twitter.