|
@@ -783,14 +783,16 @@ public class EmailParseService {
|
|
|
} else {
|
|
|
log.warn("{} 不支持的邮件数据 {}", folderName, emailTitle);
|
|
|
}
|
|
|
-
|
|
|
- if (CollUtil.isNotEmpty(emailContentInfoDTOList)) {
|
|
|
- emailContentInfoDTOList.forEach(e -> {
|
|
|
- e.setEmailType(emailType);
|
|
|
- e.setSenderEmail(senderEmail);
|
|
|
- });
|
|
|
- emailMessageMap.put(uuidKey, emailContentInfoDTOList);
|
|
|
+ if (CollUtil.isEmpty(emailContentInfoDTOList)) {
|
|
|
+ log.warn("{} 邮件{} 没有获取到附件", folderName, emailTitle);
|
|
|
+ continue;
|
|
|
}
|
|
|
+
|
|
|
+ emailContentInfoDTOList.forEach(e -> {
|
|
|
+ e.setEmailType(emailType);
|
|
|
+ e.setSenderEmail(senderEmail);
|
|
|
+ });
|
|
|
+ emailMessageMap.put(uuidKey, emailContentInfoDTOList);
|
|
|
if (log.isInfoEnabled()) {
|
|
|
log.info("{} 邮件{} 下载完成,总计耗时{} ms,文件内容如下\n {}", folderName,
|
|
|
emailTitle, System.currentTimeMillis() - start, emailContentInfoDTOList);
|
|
@@ -811,9 +813,11 @@ public class EmailParseService {
|
|
|
List<EmailContentInfoDTO> emailContentInfoDTOList) throws Exception {
|
|
|
String fileName = EmailUtil.decodeFileName(part);
|
|
|
if (StrUtil.isBlank(fileName)) {
|
|
|
- log.warn("邮件{} 附件文件名是空的,不做下载!", subject);
|
|
|
return;
|
|
|
}
|
|
|
+ if (fileName.contains("\"")) {
|
|
|
+ fileName = fileName.replaceAll("\"", "");
|
|
|
+ }
|
|
|
if (fileName.contains("=?")) {
|
|
|
fileName = MimeUtility.decodeText(fileName);
|
|
|
}
|