• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 169
  • Last Modified:

Obtaining the original email from a forward

I want to be able to extract the original message from one that has been forwarded by a variety of email clients. I have tried some simple regex stuff - taking all lines beginning with '>', grabbing everything beneath a line saying 'forwarded message' and so on. With hundreds of email clients out there, the cases that my code has to handle is becomming very large.

Does anyone have any advice or know of any module (I tried a CPAN search) that could help?
0
bergsy
Asked:
bergsy
1 Solution
 
ahoffmannCommented:
will be a hard job to do, 'cause any good MUA can define the ident charcter as the user likes (for example: > is the most common, but ! is also used, others use blanks, or do it like news, or prefix each line with a uniq ident string like chat, etc. etc.)

Don't think that you'll find a perl module for this, 'cause there are infinit variations.
Sounds to me that this problem is one where humans are almost always better and faster than sophisticated programs ;-)

Things might be simple if you have a limited list of small ident strings, like:
  "^> "
  "^! "
  "^>>"
  "^\t|"
and hope that they are not intermixed in your mail.
0
 
inq123Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept a comment by ahoffmann

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

inq123
EE Cleanup Volunteer
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now