Solved

Obtaining the original email from a forward

Posted on 2002-05-29
2
154 Views
Last Modified: 2010-03-05
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
Comment
Question by:bergsy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 200 total points
ID: 7042602
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
 
LVL 8

Expert Comment

by:inq123
ID: 9512431
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question