You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2009/10/13 13:52:50 UTC
DO NOT REPLY [Bug 47991] New: HSMF - All .msg attachments have zeros
at the end of the files
https://issues.apache.org/bugzilla/show_bug.cgi?id=47991
Summary: HSMF - All .msg attachments have zeros at the end of
the files
Product: POI
Version: 3.6-dev
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: HSMF
AssignedTo: dev@poi.apache.org
ReportedBy: yoda@oleco.net
If an attachment is read from a msg file via the getAttachmentFiles() of the
MapiMessage class and streamed to a file, the result will be a file with even
length and lots of zeros in the end. For example a PDF file ends with
%%EOF{CR}, but the attachment from the msg show in an editor:
%%EOF{CR}{NUL}{NUL}{NUL}{NUL}{NUL}{NUL}{NUL}{NUL}{NUL}{NUL}{NUL}.
Just compare the original files that were put into the msg and the result of
the getAttachmentFiles() method using a diff tool and you will see. Outlook
extracts the attachments correctly by the way, it seems to know the exact
length of the files.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 47991] HSMF - All .msg attachments have zeros at
the end of the files
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47991
--- Comment #2 from yoda@oleco.net 2009-12-11 04:00:00 UTC ---
Created an attachment (id=24690)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=24690)
Test files as zip, contains msg and attachments before and after processing
My sample code:
MAPIMessage mapiMsg = new MAPIMessage( new FileInputStream( new
File("plain.msg") ) );
Map<String, ByteArrayInputStream> atts = mapiMsg.getAttachmentFiles();
if( atts != null && atts.size() == 1 )
{
String attName = atts.keySet().iterator().next();
ByteArrayInputStream att = atts.get( attName );
FileUtils.stream( att, new FileOutputStream( new File("after.txt") ) );
}
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 47991] HSMF - All .msg attachments have zeros at
the end of the files
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47991
--- Comment #3 from Nick Burch <ni...@torchbox.com> 2009-12-11 04:43:39 UTC ---
Please do keep looking for a file that displays this problem, and which you can
share. Without the message to investigate, there's unfortunately nothing we can
do to fix it.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 47991] HSMF - All .msg attachments have zeros at
the end of the files
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47991
yoda@oleco.net changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |RESOLVED
Resolution| |WORKSFORME
--- Comment #4 from yoda@oleco.net 2010-06-01 03:37:51 EDT ---
I tried again with the newer revision 898295 (Jan 12 2010) and it seems to work
now for me, but you and me should keep an eye on it :-)
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 47991] HSMF - All .msg attachments have zeros at
the end of the files
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47991
Nick Burch <ni...@torchbox.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |NEEDINFO
--- Comment #1 from Nick Burch <ni...@torchbox.com> 2009-11-03 16:10:11 UTC ---
Can you upload a sample .msg file with an attachment that displays this
behaviour? We'll want to use that so we have something to test a fix against
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org