|
@@ -74,7 +74,8 @@ public class EmailParseService {
|
|
|
"application/zip",
|
|
|
"application/x-zip-compressed",
|
|
|
"application/rar",
|
|
|
- "application/x-rar-compressed"
|
|
|
+ "application/x-rar-compressed",
|
|
|
+ "application/octet-stream"
|
|
|
// 按需添加其他类型...
|
|
|
);
|
|
|
|
|
@@ -215,7 +216,7 @@ public class EmailParseService {
|
|
|
}
|
|
|
|
|
|
// 文件中的类型判断
|
|
|
- if (emailType == null || !EmailTypeConst.SUPPORT_EMAIL_TYPES.contains(emailType)) {
|
|
|
+ if (emailType == null || !EmailTypeConst.SUPPORT_NO_OTHER_TYPES.contains(emailType)) {
|
|
|
emailType = EmailUtil.getEmailTypeBySubject(emailContentInfoDTO.getFileName());
|
|
|
emailContentInfoDTO.setEmailType(emailType);
|
|
|
}
|
|
@@ -816,12 +817,14 @@ public class EmailParseService {
|
|
|
String disposition = part.getDisposition();
|
|
|
String contentType = part.getContentType();
|
|
|
|
|
|
- boolean isAttachment = Part.ATTACHMENT.equalsIgnoreCase(disposition)
|
|
|
+ boolean attachmentFlag = StrUtil.endWithAny(fileName, ".zip", ".rar", ".pdf", ".png", ".jpg", ".docx");
|
|
|
+ boolean isAttachment = attachmentFlag
|
|
|
+ || Part.ATTACHMENT.equalsIgnoreCase(disposition)
|
|
|
|| (contentType != null && attachmentMimePrefixes.stream().anyMatch(prefix ->
|
|
|
StrUtil.startWithIgnoreCase(contentType, prefix)
|
|
|
));
|
|
|
if (!isAttachment) {
|
|
|
- log.warn("邮件 {} 未检测到pdf/zip/rar类型的附件 (fileName={}, disposition={}, contentType={})",
|
|
|
+ log.warn("邮件 {} 未检测到pdf/zip/rar/png/jpg/docx类型的附件 (fileName={}, disposition={}, contentType={})",
|
|
|
subject, fileName, disposition, contentType);
|
|
|
return;
|
|
|
}
|