#!/usr/bin/perl use Net::SMTP; #use strict; my @data; my $i=0; my $from = 'badfromaddress'; my $body = 0; while (<>) { $from = $1 if ((!$body) && (/^From\s+(\S+)/)); s/^To:\s+.*/To: correctbloggeraddress\@blogger.com/g; if ($body) { s/(\S+?)\s*<(.+?)>/$1<\/A>/g; # Convert hyperlinks s/^\s*$/\

/g; # Turn paragraphs into line breaks } $body = 1 if (/^$/); last if (/^--\s*$/); # Separator of the signature, discard it and the rest. $data[$i++] = $_; } while (<>) { } my $to = 'badtoaddress'; if ($from eq 'correctsenderaddress')) { $to = 'correctbloggeraddress'; # Only blog it if I wrote it } my $smtp = Net::SMTP->new( 'inferno.sifry.com', Hello => 'inferno.sifry.com', Debug => 0, ); $smtp->mail($from); $smtp->to($to); $smtp->data(@data); $smtp->quit; exit 0;