diff --git a/roles/pmg/files/imap-sa-learn b/roles/pmg/files/imap-sa-learn index 0cd2ec3..941de03 100644 --- a/roles/pmg/files/imap-sa-learn +++ b/roles/pmg/files/imap-sa-learn @@ -113,7 +113,10 @@ sub crawl_imap_dir { my $inner_found = 0; foreach my $part ($entity->parts) { if ($part->effective_type eq 'message/rfc822'){ - sa_learn($part->stringify, $type); + # Remove the first 3 lines which presents the raw mail, but as an attachment + my @lines = split /\n/, $part->stringify; + splice @lines,0,3; + sa_learn(join("\n", @lines), $type); $inner_found = 1; } }