Solved

Obtaining the original email from a forward

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
perl search and replace 6 168
pattern matching in perl 2 103
Call Shell Script from Perl Script 6 100
parse a file and get data out 11 44
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

770 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