Subject: | Suggested changes |
Hi there; have found the following issues and provide the code I used below
1) There's a number of extra bits that hotmail adds as headers to the
original email; suggest stripping them out
2) Get the Original-Rcpt-To from the hotmail report
my $part = ($msg->parts)[0];
# Get the original email and strip off all the extra header bits
my $orig_email = $part->body;
$orig_email =~ s/^(.*?)\n(Received: )/$2/s;
my $hotmail_headers = Email::Simple::Header->new( $1 );
my $original = Email::MIME->new( $orig_email );
my %fields = (
'Feedback-Type' => 'abuse',
);
($fields{"Source-IP"}) = $msg->header("Subject") =~ /^complaint
about message from (\w+$)/;
$fields{'Original-Rcpt-To'} =
$hotmail_headers->header('X-HmXmrOriginalRecipient');
return Email::ARF::Report->create(
original_email => $original,
description => "Abuse report from hotmail",
fields => \%fields
);
Our reports also appear to come simply 'From: staff@hotmail.com' without
any of those sender/original sender headers that you check for.
Hope this helps,
Mark