Skip to content

Commit a1fc1b9

Browse files
committed
#83 Interpret inline attachments without ID as normal attachments
1 parent d63c2c1 commit a1fc1b9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: src/main/java/org/simplejavamail/converter/internal/mimemessage/MimeMessageParser.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,16 @@ private void parse(final MimePart part)
209209
}
210210
} else {
211211
final DataSource ds = createDataSource(part);
212-
// If the diposition is not provided, the part should be treat as attachment
212+
// If the diposition is not provided, the part should be treated as attachment
213213
if (part.getDisposition() == null || Part.ATTACHMENT.equalsIgnoreCase(part.getDisposition())) {
214214
this.attachmentList.put(parseResourceName(part.getContentID(), part.getFileName()), ds);
215215
} else if (Part.INLINE.equalsIgnoreCase(part.getDisposition())) {
216-
this.cidMap.put(part.getContentID(), ds);
216+
if (part.getContentID() != null) {
217+
this.cidMap.put(part.getContentID(), ds);
218+
} else {
219+
// contentID missing -> treat as standard attachment
220+
this.attachmentList.put(parseResourceName(null, part.getFileName()), ds);
221+
}
217222
} else {
218223
throw new IllegalStateException("invalid attachment type");
219224
}

0 commit comments

Comments
 (0)