I believe that there is no such module, because this task is oriented and there is a huge variety of message formatting styles. A minimal implementation is what you can do with a few lines of code:
use Email::MIME; my $email = Email::MIME->new($message); my $body; $email->walk_parts(sub { my ($part) = @_; return unless $part->content_type =~ m[text/plain]; $body .= $part->body; });
Of course, you can add other heuristic rules to remove attribution strings written in other languages, as well as delete Outlook-style text. I would suggest some heuristics to avoid quoting text if a message using alternating-style quoting is recognized. This is because alternating answers may lose some meaning if you separate the quoted text.
If you want this to affect the module, I would call it Email::ExtractBody or Email::ExtractText . I would like to emphasize in POD that the module has a heuristic and best approach.
source share