?
Solved

Obtaining the original email from a forward

Posted on 2002-05-29
2
Medium Priority
?
161 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 400 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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…
Six Sigma Control Plans
Suggested Courses

777 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