Msg file sender address is invalid in outlook

Last post 05-01-2012, 6:45 AM by aspose.notifier. 23 replies.
Page 1 of 2 (24 items)   1 2 Next >
Sort Posts: Previous Next
  •  01-23-2012, 11:48 PM 356833

    Msg file sender address is invalid in outlook Java

    Attachment: Present (inaccessible)
    Hi,

    I'm trying to remove attachments from a .msg file and save the email to disk using the MailMessage class.

    MailMessage origMessage = MailMessage.load( "C:\\Temp\\new.msg" ), MessageFormat.getMsg());

    origMessage.getAttachments().clear();

    FileOutputStream fileOut = new FileOutputStream("C:\\Temp\\testupload.msg");
    origMessage.save(fileOut, MailMessageSaveType.getOutlookMessageFormat());


     The saved email's from address is in the following  (exchange?)format:

    "firstname lastname" </O=TEST/OU=TEST1/CN=RECIPIENTS/CN=TEST>

    When the saved email is opened in Outlook, the sender name is not recognised/interpreted by Outlook as its doesnt have the email address. The to/cc/bcc addresses look correct.

    Is there a way to get the email address of the sender of an .msg file using MailMessage or to get the sender/from address to be in the format that Outlook understands?

    I've attached a sample .msg file as well as a screenshot of the saved email once opened from Outlook.

     
  •  01-24-2012, 4:09 AM 356886 in reply to 356833

    Re: Msg file sender address is invalid in outlook Java

    Hi Chamindu,

    Thank you for your inquiry. 

    I have tested your said issue with latest version of Aspose.Email for Java v1.2.0 and a sample file (with attachments) of my own. I was unable to replicate the problem at my end. The email address in From field of the resultant message is in Smtp format i.e. "from@domain.com". Please give a try to the latest version and feed us back with your results.

    I believe you have shared your output file with us, cause it doesn't have any attachments. We will require your input message file so we may test the issue on our end.

    Looking forward for your response.

    Babar Raza
    Support Developer,
    Aspose Sialkot Team
    http://www.aspose.com/
    Aspose - Your File Format Experts
     
  •  01-24-2012, 3:53 PM 357046 in reply to 356886

    Re: Msg file sender address is invalid in outlook

    Hi,

    The sample input file I used (testupload.msg) has been attached to this post.i.e. testupload.zip.It doesn't have any attachments but the problem with the invalid sender address happens with or without attachments.

    I'm using "aspose-email-1.2.0-java" library which I believe is the latest version.

    Can you please try with the sample file testupload.msg?

    thanks
    Chamindu
     
  •  01-25-2012, 2:25 AM 357117 in reply to 357046

    Re: Msg file sender address is invalid in outlook Java

    Hi Chamindu,

    Thank you for your response.

    Yes, Aspose.Email for Java v1.2.0 is the latest version and I am able to observe the said behaviour with your provided sample file (testupload.msg). I have logged an investigation in our tracking system to probe further into this matter. The ticket Id for your reference is NETWRKJAVA-33118.

    I have also observed that the said problem is reproduce-able with just this file. I have tried several other message files (with or without attachments) but unable to replicate the issue. So, I would like to know the origin of specified message. 

    Thanks and Regards,

    Babar Raza
    Support Developer,
    Aspose Sialkot Team
    http://www.aspose.com/
    Aspose - Your File Format Experts
     
  •  01-26-2012, 3:52 PM 357508 in reply to 357117

    Re: Msg file sender address is invalid in outlook Java

    Hi,

    Thanks for logging a ticket. Good to know you can reproduce the issue.
    The input file was saved from Outlook 2007. However I have observed the same behavior when messages are saved from Outlook 2003 as well.
    The issue only happens if the sender is from within our organisation/domain and only with the sender address, the to/cc/bcc addresses are interpreted correctly even if they are from within the organisation.

    Does this have anything to do with the fact that we use Exchange Server?

    thanks & regards
     
  •  01-27-2012, 12:40 AM 357570 in reply to 357508

    Re: Msg file sender address is invalid in outlook Java

    Hi Chamindu,

    Thank you for providing the further details in this regard. The new information will definitely help us in sorting out the cause of problem. I have attached your comments to the ticket already associated with this thread and we will keep you posted with updates on this.

    Regards,

    Babar Raza
    Support Developer,
    Aspose Sialkot Team
    http://www.aspose.com/
    Aspose - Your File Format Experts
     
  •  01-31-2012, 9:17 PM 358483 in reply to 357570

    Re: Msg file sender address is invalid in outlook

    Hi,

    I was wondering if there has been any progress on this issue?


    Regards,

     
  •  02-01-2012, 5:38 AM 358608 in reply to 358483

    Re: Msg file sender address is invalid in outlook .NET

    Hi,

    I am afraid that I haven't received any updates in this regard. Although I have requested the development to provide an ETA. As soon as I get any further details, I will post here for your reference.

    Thank you for your patience.

    Babar Raza
    Support Developer,
    Aspose Sialkot Team
    http://www.aspose.com/
    Aspose - Your File Format Experts
     
  •  02-06-2012, 9:24 PM 359603 in reply to 358608

    Re: Msg file sender address is invalid in outlook

    Hi,

    Is there any update on this issue? 
    If you can provide some kind of ETA that would be good. I'm doing an evaluation of this library for our company and I need to give a resolution for this issue or at least be able to say a solution is on the way.

    Any feedback would be greatly appreciated as I'm waiting to give the go ahead to purchase this library.

    thanks & regards!

     
  •  02-07-2012, 1:08 AM 359636 in reply to 359603

    Re: Msg file sender address is invalid in outlook Java

    Hi,

    I am afraid, I have not received any updates on this issue in particular to the Java version of Aspose.Email component. Although, we were able to reproduce the said problem with Aspose.Email for .NET v1.4.0. So we have logged a separate ticket and currently we are trying to find out the cause of this behaviour. As soon as our investigation is complete, we will move forward to fix the problem (for both .NET and Java) and then we will be able to share an ETA.

    Meanwhile, I am looking for any possible workaround for your situation. One possible workaround is to load the message in an instance of MapiMessage instead of MailMessage. Please check the below source code for your reference,

    Java
    MapiMessage origMessage = MapiMessage.fromFile("testupload.msg"); origMessage.getAttachments().clear(); FileOutputStream fileOut = new FileOutputStream("output.msg"); origMessage.save(fileOut);


    Babar Raza
    Support Developer,
    Aspose Sialkot Team
    http://www.aspose.com/
    Aspose - Your File Format Experts
     
  •  02-08-2012, 4:30 PM 360209 in reply to 359636

    Re: Msg file sender address is invalid in outlook

    Hi,

    Thanks for the info & the workaround suggested.
    Unfortunately I need to use the MailMessage class as it works more accurately in some of the other functionality I need including:
    - extracting embedded emails & their attachments (non-embedded images) 
    - saving each email & its embedded email without attachments it its native format e.g. .eml or .msg

    I found that MapiMessage behaves inconsistently in some of the above areas.

    MailMessage class works well for both formats in all the areas with the exception of this particular issue. I am reluctant to change the all my code as it will be significant effort to retest all the functionality and I will have to still log issues with you for the areas that MapiMessage doesn't work.

    I tried the following workarounds with no luck:

    1) convert MailMessage to MapiMessage using the line below but the sender address still ends up being incorrect:

    MapiMessage mapiMsg = MapiMessage.fromMailMessage(origMessage);

    2) extract the from address from MapiMessage and set it in MailMessage:

    origMessage.getHeaders().set("From",  mapiMsg.getHeaders().get("From"));

    But the sender address is wrong in certain scenarios or examples of .msg files.

    Regards,



    Regards,
    Chamindu
     
  •  02-09-2012, 3:14 AM 360312 in reply to 360209

    Re: Msg file sender address is invalid in outlook

    Hi Chamindu,

    Thank you for the further elaboration. 

    We are currently working on this issue. As soon as I get any updates, I will let you know here.

    chEmailTest:
    I found that MapiMessage behaves inconsistently in some of the above areas.

    Will you be kind enough to provide us some samples showing inconsistent behaviour of MapiMessage class? We will look into them as well.

    Regards,

    Babar Raza
    Support Developer,
    Aspose Sialkot Team
    http://www.aspose.com/
    Aspose - Your File Format Experts
     
  •  02-09-2012, 11:30 PM 360544 in reply to 360312

    Re: Msg file sender address is invalid in outlook

    Attachment: Present (inaccessible)
    Hi,

    I've tried to use the MapiMessage class and found that this class solved the invalid sender address issue.
    However, I have a problem when I try to remove one or more attachments from the email.

    Basically I need to make sure the email is stripped of all attachments and saved with any embedded images in the body. When the MapiMessage class is used embedded images and normal attachments are both found in the attachment collection. So I tried to identify the attachments that aren't embedded images and only remove them. But when I do this and try to open the email I get an error "Could not open one or more attachments".

    Here is my code:

    MapiMessage origMessage = MapiMessage.fromFile("C:\\Temp\\inputfiles\\test2\\test email with embedded images.msg");
    for (int i = 0; i < origMessage.getAttachments().size(); i++) 
    {
         MapiAttachment attachment = (MapiAttachment) origMessage.getAttachments().get(i);
         if (attachment.getProperties().contains(0x3712001E) || attachment.getProperties().contains(0x3712001F)) {
             // Embedded image leave it in the email
         } else {
         
             // Normal attachment, remove from the email
             origMessage.getAttachments().remove(i);
             i = i - 1;
         }

    origMessage.save("C:\\Temp\\inputfiles\\test2\\out.msg");

    The problem appears to be because I am trying to remove an item from the collection when there are other items after it. The problem can also be reproduced by doing the following:

    MapiMessage origMessage = MapiMessage.fromFile("C:\\Temp\\inputfiles\\test2\\test email with embedded images.msg");
    origMessage.getAttachments().remove(0);        
    origMessage.save("C:\\Temp\\inputfiles\\test2\\out.msg");

    When you open "out.msg" it will show the error I mentioned earlier. I've attached the input file I used for this to the post.

    What is the best way to remove items from the attachments collection at different positions?

    Regards,

     
  •  02-11-2012, 4:35 AM 360863 in reply to 360544

    Re: Msg file sender address is invalid in outlook Java

    Hi Chamindu,

    Thank you for providing us further details and your sample. We are currently looking into it to suggest you a feasible solution for your said problem.  Please spare us some time for the analysis. 

    Regards,

    Babar Raza
    Support Developer,
    Aspose Sialkot Team
    http://www.aspose.com/
    Aspose - Your File Format Experts
     
  •  02-14-2012, 12:49 AM 361314 in reply to 360863

    Re: Msg file sender address is invalid in outlook Java

    Hi Chamindu, 

    Sorry for the delayed response on this. 

    We found that your said issue is correct while using the MapiMessage class to remove any regular attachments. We are still looking into it to provide you a workaround for your situation. 

    Babar Raza
    Support Developer,
    Aspose Sialkot Team
    http://www.aspose.com/
    Aspose - Your File Format Experts
     
Page 1 of 2 (24 items)   1 2 Next >
View as RSS news feed in XML