Solved

Obtaining the original email from a forward

Posted on 2002-05-29
2
149 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
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
perl exit code 2 246
Perl script to parse log and delete the file 17 171
Perl 101 11 68
Perl tar error 8 32
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now