Skip to content

outlookMsgToEmail loses nested msg attachments #298

@atmcq

Description

@atmcq

Code:

public static void main(String[] args) throws IOException {
    viewMsg();
    viewEml();		
}
	
public static void viewMsg() throws IOException {
    Email em1 = EmailConverter.outlookMsgToEmail(new File("Email.msg"));
    System.out.println("--------------------------------------------------------");
    System.out.println(em1.getSubject());
    System.out.println(em1.getAttachments());
    System.out.println("--------------------------------------------------------");
}

public static void viewEml() throws IOException {
    Email em1 = EmailConverter.emlToEmail(new File("Email.eml"));
    System.out.println("--------------------------------------------------------");
    System.out.println(em1.getSubject());
    System.out.println(em1.getAttachments());
    System.out.println("--------------------------------------------------------");
}

Expected result:

Email
AttachmentResource 
{
name='PHOTO-2020-02-18-07-42-08_1.jpg',
dataSource.name=PHOTO-2020-02-18-07-42-08_1.jpg,
dataSource.getContentType=image/jpeg
}, 
AttachmentResource{
name='This msg file is an attachment.msg',
dataSource.name=This msg file is an attachment.msg,
dataSource.getContentType=application/octet-stream
}
--------------------------------------------------------

--------------------------------------------------------
Email
AttachmentResource
{
name='PHOTO-2020-02-18-07-42-08_1.jpg',
dataSource.name=PHOTO-2020-02-18-07-42-08_1.jpg,
dataSource.getContentType=image/jpeg
}, 
AttachmentResource{
name='This msg file is an attachment.msg',
dataSource.name=This msg file is an attachment.msg,
dataSource.getContentType=application/octet-stream
}]
--------------------------------------------------------

Actual result:

Email
AttachmentResource
{
name='PHOTO-2020-02-18-07-42-08_1.jpg',
dataSource.name=PHOTO-2020-02-18-07-42-08_1.jpg,
dataSource.getContentType=image/jpeg
}
--------------------------------------------------------

--------------------------------------------------------
Email
AttachmentResource
{
name='PHOTO-2020-02-18-07-42-08_1.jpg',
dataSource.name=PHOTO-2020-02-18-07-42-08_1.jpg,
dataSource.getContentType=image/jpeg
}, 
AttachmentResource
{
name='This msg file is an attachment.msg',
dataSource.name=This msg file is an attachment.msg,
dataSource.getContentType=application/octet-stream
}
--------------------------------------------------------

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions