Extract Most Recent Message from a Forwarded One

Hi,
I am using JavaMail API to mainly extract mails from a mail server and store them on the hard drive. I have been able to successfully save text, attachments and embedded images. The problem I am facing is that if a message is forwarded (assuming no changes were made while forwarding the message) then I am unable to extract just the added message part in it. I do not want to save the complete thread as that would result in duplication of messages. Also, if a message contains an image and the message is forwarded without any new image, while retrieving the email content/image the image gets saved twice.
Using JavaMail API, is there any way I can identify the most recent thread (message body part) and just save that? This would also help in avoiding saving the image twice.
Just a reminder, I am not using JavaMail to send mails but only to retrieve them from a mail server.
Thanks,
Neha
Edited by: neha29 on Jul 16, 2008 2:07 PM

I don't understand "unable to extract". Does that mean "I can't figure out how to do it"?
Or does it mean "I did what I thought was necessary but it failed for a reason I won't
tell you"?
You've read the JavaMail FAQ on forwarding messages, right?
If a message is forwarded as an attachment, it should be easy to save just the attached
message. If that's what you're doing and it's not working, I need more details.
If a message is forwarded "inline", there's no guaranteed way to separate the original
message from the text that was added by the person who forwarded the message.
If that's your situation, your stuck with heuristics, which you'll have to invent yourself
to satisfy your needs.
I don't understand what you mean by "most recent thread" but I suspect the answer is no.

Similar Messages

  • In mail how do I stop messages from the same sender from showing up when I select the most recent message from a sender?

    on my iMac, when I view messages there is a grey number at the top of the message. This number denotes the amount of  messages from that sender and when I view the most recent message in my mailbox (from that sender) all of the older messages load with it and this takes a while for the message to become moarked as "read." I know that I can turn this off because I have mountain lion on my air and i do not have this issue. how can i turn it off?
    thanks

    thanks so much, that fixed it! before I posted this quiestions I kept looking in the mail preferences but I dind't think to look on the View menu.

  • How do I keep Mail from highlighting most recent messages?

    Since installing Mavericks, Mail has been highlighting my most recent messages in email threads (the unread ones). This is extremely annoying, and I messed with the Preferences>View>Highlight setting, but this setting is completely unrelated to what I am experiencing. Even if it could have something to do with it it wouldnt, because my mail is being highlighted in gray, as opposed to blue which is the default highlight color in this Mail Preference.

    Here's the answer from Marketcircle:
    This is an expected behavior in Mavericks.
    Mavericks made a change in the Mail app which Daylite Mail Assistant was not able to bring over certain items when adding them in Mail. Our temporary solution is to have the Daylite Mail Assistant highlight the content which allows for the proper import into Daylite. Our engineers are investigating ways to try and have the highlight disappear so that you don't see this.
    We apologize for the inconvenience!
    Thanks,
    Marketcircle Customer Service Team
    Looks like one problem was fixed and this one created for me. I'm not sure if you had this problem, but before Mavericks, when I would tab down in Mail from the addresses (cc, subject) then onto the main body, it would always give me a tabbed start point on the page. Very annoying, but now it doesn't do that. (another DMA problem)

  • TS3276 can anyone help on the following please. When I have been away from the office for a few days and check for emails it only supplies the most recent 100 emails and the ones before that are never received. thanks

    can anyone help on the following please. When I have been away from the office for a few days and check for emails it only supplies the most recent 100 emails and the ones before that are never received. thanks

    Does your server have a limit?

  • Help, I have just restored my iphone from last back up to retrieve vital messages that somehow disappeared.  Now I have lost the most recent messages, calendar details and photos.  How do I get them back?

    Help, I have just restored my iphone from last back up to retrieve vital messages that somehow disappeared.  Now I have lost the most recent messages, calendar details and photos.  How do I get them back?
    I have an iPhone 5S

    You restore from the backup that contained them.
    Restoring from a backup is all or nothing. It completely overwrites the data in the phone when you restore. You can not combine the contents of a backup with what's currently on your phone.

  • Transferred mail doesn't display "most recent" messages in iOS3

    I just setup a brand new Mac OS X Snow Leopard Server and began transferring mail from offline mailboxes to the IMAP structure on the server. This works fine in Apple Mail, as it displays the entire message list and keeps a local cache. However, this does not work properly on my iPad, iPhone or those same iDevices belonging to my colleagues.
    Instead, it displays a seemingly "random" list of 200 messages rather than the "most recent" messages.
    An extensive search of Apple Discussions yielded three very similar cases, all seeming to involve the transfer of mail from one server to another with similar results (errors).
    http://discussions.apple.com/thread.jspa?messageID=11656333&#11656333
    http://discussions.apple.com/message.jspa?messageID=10850276#10850276
    http://discussions.apple.com/thread.jspa?messageID=11318599&#11318599
    Has this been solved? Can someone offer me/us some help?
    FTR:
    I am running Mac OS X Snow Leopard (10.6.4), the server is also up-to-date and the iPhones/iPads are as well (3.1.3 and 3.2 respectively).
    Thank you,

    the message just isn't seen as a multipart message.
    What do you mean by that exactly? Only the plain text version is displayed?
    Send me one (tom at bluesky dot org). Not forwarded or copied -- send it to me as if I were one of the normal recipients.

  • Why is it that when I go to the search screen to find a particular message in a conversation it comes up with the message but when I click on it it takes me to the conversation where the most recent message was sent and not the message I wanted

    Why is it that when I go to the search screen and type in a particular message I want to view, my iPhone finds it but when I click on it it only takes me to the conversation at the most recently thing texted and not the particular message I clicked on?

    Never occurred to me you can search messages that way, thanks.
    Another way to do it is to scroll from the most recent message to the top of the screen and tap load more messages, repeatedly till you reach the one you want.
      I like your method better, but with both methods it refreshes to the most recent message.

  • POP email loading Old Messages, and not most recent messages: (not Gmail)

    Hi,
    I'm having an issue where my iPhone is loading old emails instead of the most recent ones on the server. I see the messages download in outlook (leave message on server). But my iPhone will download the most recent message for awhiel and it will stop.
    I have it set to display 25 messages. It used to always download the most recent messages and push the old messages out. (i'd have to hit download 25 more to see more). But now it no longer does this. Also, when i delete a few messages, it downloads some messages, but not the most recent ones. Also tried completely deleteing the account and starting over. But after it fills up, the same thing happens. It worked fine for a few weeks, then it started having this problem.
    I've tried deleting all email, but eventually it fills up and then starts doing the same thing.
    Thoughts and help would be appreciated.

    Those messages which iphone can't get are Junk mails..
    First remove the account,
    Go to Setting/mail and choose "show 50 or more recent messages".
    Add your account again.
    go back to mail settings
    choose your account at the top of add account...
    go to advanced
    below the deleted messages
    remove... choose "after one day"
    under the incoming setting, delete from server choose "7 days" (which is quite enough time to keep)..
    Thats all.. Fixed on my phone..
    This phone is not your real mailbox. Use it to check only or respond After that delete them...
    Don't keep your mails in it. Use Mail, Entourage or Outlook etc..
    Peace..

  • My Iphone was sync with Itunes on a computer then this computer broke down and i purchased another one. I was able to extract all the data from the old one. now how can i sync my phone with the new tunes without loosing any data?

    My Iphone was sync with Itunes on a computer then this computer broke down and i purchased another one. I was able to extract all the data from the old one. now how can i sync my phone with the new tunes without loosing any data?

    Yes, windows to Mac too.
    iTunes: How to move [or copy] your music [library] to a new computer [or another drive] - http://support.apple.com/kb/HT4527
    Quick answer if you use iTunes' default preferences settings:  Copy the entire iTunes folder (and in doing so all its subfolders and files) intact to the other drive.  Open iTunes and immediately hold down the Option (alt) key (shift on Windows), then guide it to the new location of the library.
    Windows users see tip at: https://discussions.apple.com/message/18879381

  • How to have email conversation take on appearance of most recent message?

    I've setup a variety of email rules to change the background colour of messages based on a particular header field.  Basically, messages are coloured red, orange, yellow, or green, depending on their state in a workflow.
    The problem is that collapsed conversations seem to take the background colour of the first message in the conversation, not the last (most recent message).
    Is it possible to have the collapsed conversation take on the appearance of the most recent message?

    Hi
    Perhaps you could use an on-demand application process instead - you can specify these in the URL.
    The URL syntax (for your link) would be like...
    f?p=application_id:page_id:session:APPLICATION_PROCESS=process_idIs this what you mean?
    Cheers
    Ben

  • Mail 7.0 Does Not Default to Most Recent Message?

    With Mail 7.0 and OS 10.9, I'm no longer looking at my most recent messages when I open the Mail app.
    Why is this, and what can I do to fix it?

    Ive quit Mail, restarted my computer. Updated whatever there was to update and its still the same.
    See screenshot.
    I get a date stamp and the sender icon/avatar but thats about it - see first screen shot - however,  I can mouse over the reply action part of the message window and the action buttons appear. Sadly, the content of the message does not appear when I mouse over.

  • I revive messages from everyone but one person on my phone I had my iMessage on my iPad but I turned it off and also off on my phone but I can't seem too receive messages from them but they get mine,?

    I revive messages from everyone but one person on my phone I had my iMessage on my iPad but I turned it off and also off on my phone but I can't seem too receive messages from them but they get mine,?

    They have an iOS device? If so, have them send as an SMS, not an iMessage.

  • How to determine most recent date from the date column of internal table

    Dear friends
    would you like to tell me. how i determine the most recently changed record by looking at date and time from internal table i am not supposed to sort the table by date and time... I must check date and time with other records date and time to determine which record is most recently changed...
    here the scenario is.
    id idnumber chdate chtime
    1 123456 20060606 135312
    2 123456 20060606 135900
    3 123456 20060606 132300
    4 123457 20060606 140000
    5 123457 20060606 142500
    in the above scenario i must keep in my mind that the most recently changed record is identical to its idnumber i can say that:
    the record should be fetched this way
    id idnumber chdate chtime
    3 123456 20060606 132300
    5 123457 20060606 142500
    because here the id 3 is the most recently changed in the idnumber 123456
    where id 5 is the most recently changed in the idnumber 123457
    please help me to determin how i am supposed to carry out this task any suggestion, code will be great help of mine.
    regards
    Naim

    After testing my suggestion above, I realized that it doesn't work because the delete adjacent actually will keep the first one and delete the rest.  I'm working with Srinivas's code a bit now,  I think it is almost what you want.  I am under the impression that you dont' want to HIGHest date/time, but just the last record of the sequence, if this is the case, then this code will help.  Here we will assign an index to each record per the idnumber, that way we can sort it and get the lastest record.
    report zrich_0001.
    types: begin of itab_type,
            id       type i,
            idnumber type i,
            chdate   like sy-datum,
            chtime   like sy-uzeit.
    types: end of itab_type.
    types: begin of itab_type2,
            id       type i,
            idnumber type i,
            index    type i,
            chdate   like sy-datum,
            chtime   like sy-uzeit.
    types: end of itab_type2.
    data: itab     type table of itab_type with header line,
          itab2    type table of itab_type2 with header line,
          prev_rec type itab_type.
    data: v_id type i.
    start-of-selection.
      itab-id       = 1.
      itab-idnumber = 123456.
      itab-chdate   = '20060606'.
      itab-chtime   = '135312'.
      append itab. clear itab.
      itab-id       = 2.
      itab-idnumber = 123456.
      itab-chdate   = '20060606'.
      itab-chtime   = '135900'.
      append itab. clear itab.
      itab-id       = 3.
      itab-idnumber = 123456.
      itab-chdate   = '20060606'.
      itab-chtime   = '142500'.
      append itab. clear itab.
      itab-id       = 4.
      itab-idnumber = 123457.
      itab-chdate   = '20060606'.
      itab-chtime   = '140000'.
      append itab. clear itab.
      itab-id       = 5.
      itab-idnumber = 123457.
      itab-chdate   = '20060606'.
      itab-chtime   = '120000'.
      append itab.
      clear itab.
    <b>  data: counter type i.
    * Assign an index to each row per idnumber
      loop at itab.
        on change of itab-idnumber.
        if sy-tabix > 1.
          clear counter.
          endif.
        endon.
        clear itab2.
        move-corresponding itab to itab2.
        counter = counter + 1.
        itab2-index = counter.
        append itab2.
      endloop.
    * Sort it and get rid of older records.
      sort itab2  by idnumber ascending
                     index descending.
      delete adjacent duplicates from itab2 comparing idnumber.</b>
      read table itab2 with key idnumber = '123456'.
      write:/ itab2-chdate, itab2-chtime.
      read table itab2 with key idnumber = '123457'.
      write:/ itab2-chdate, itab2-chtime.
    Regards,
    Rich Heilman

  • How do I change mail so only the most recent mail from a person opens?

    When I open mail and go to a new mail all of the files/documents that, that person has ever sent me from previous days open as well. The other emails that I do not want also show up on the right side of my mail in the preview the document part. How do I change it so that I only see the email I am clicking on not a scrolling document of all of the mail items the sender has sent me. Also how do I change it so I only see the most recent item (the one I am clicking on) in the preview email on the right side? Thanks

    In the View menu, uncheck (Expand All Conversations).

  • Choosing most recent records from multiple tables?

    Let's say that you have two tables; one contains news
    articles with the fields TITLE, ARTICLE, and a timestamp DATE and
    the other contains different news articles with the fields TITLE,
    DESCRIPTION, and a timestamp DATEPOSTED.
    How would you go about selecting the (let's say) five most
    recent articles with the corresponding fields? I'm relatively new
    to CF but even the experienced guy in our office can't figure it
    out. The following code is what we were working with -- which
    doesn't quite work the way it should anyway -- but I'm thinking
    there
    must be an easier (or at least less convoluted) way.

    Thank you so much! Azadi hit the nail on the head; I hadn't
    known the terms to look for so Google hadn't been any help, but
    UNION was just the trick for this MySQL query. I had to add a field
    to each table in order to tell the link which page to go to since
    there's a different one depending on which table the record came
    from, but here's the code that works (just in case anyone else does
    a search for this problem):

Maybe you are looking for