Skip to content

Commit

Permalink
#83 Interpret inline attachments without ID as normal attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
bbottema committed Aug 12, 2017
1 parent d63c2c1 commit a1fc1b9
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,16 @@ private void parse(final MimePart part)
}
} else {
final DataSource ds = createDataSource(part);
// If the diposition is not provided, the part should be treat as attachment
// If the diposition is not provided, the part should be treated as attachment
if (part.getDisposition() == null || Part.ATTACHMENT.equalsIgnoreCase(part.getDisposition())) {
this.attachmentList.put(parseResourceName(part.getContentID(), part.getFileName()), ds);
} else if (Part.INLINE.equalsIgnoreCase(part.getDisposition())) {
this.cidMap.put(part.getContentID(), ds);
if (part.getContentID() != null) {
this.cidMap.put(part.getContentID(), ds);
} else {
// contentID missing -> treat as standard attachment
this.attachmentList.put(parseResourceName(null, part.getFileName()), ds);
}
} else {
throw new IllegalStateException("invalid attachment type");
}
Expand Down

0 comments on commit a1fc1b9

Please sign in to comment.