|
@@ -657,8 +657,10 @@ public class EmailParseService {
|
|
|
return emailMessageMap;
|
|
|
}
|
|
|
|
|
|
- private void rePart(String account, String subject, Date sendDate, Part part, List<EmailContentInfoDTO> emailContentInfoDTOList) throws Exception {
|
|
|
+ private void rePart(String account, String subject, Date sendDate, Part part,
|
|
|
+ List<EmailContentInfoDTO> emailContentInfoDTOList) throws Exception {
|
|
|
String disposition = part.getDisposition();
|
|
|
+ String fileName = MimeUtility.decodeText(part.getFileName());
|
|
|
if (disposition != null && (disposition.equals(Part.ATTACHMENT) || disposition.equals(Part.INLINE))) {
|
|
|
String emailDate = DateUtil.format(sendDate, DateConst.YYYYMMDDHHMMSS24);
|
|
|
String emailDateStr = DateUtil.format(sendDate, DateConst.YYYYMMDD);
|
|
@@ -666,7 +668,6 @@ public class EmailParseService {
|
|
|
|
|
|
EmailContentInfoDTO emailContentInfoDTO = new EmailContentInfoDTO();
|
|
|
|
|
|
- String fileName = MimeUtility.decodeText(part.getFileName());
|
|
|
emailContentInfoDTO.setFileName(fileName);
|
|
|
emailContentInfoDTO.setFileSize(part.getSize());
|
|
|
|
|
@@ -695,10 +696,13 @@ public class EmailParseService {
|
|
|
emailContentInfoDTO.setEmailTitle(subject);
|
|
|
emailContentInfoDTO.setEmailDate(DateUtil.format(sendDate, DateConst.YYYY_MM_DD_HH_MM_SS));
|
|
|
emailContentInfoDTOList.add(emailContentInfoDTO);
|
|
|
+ } else {
|
|
|
+ log.info("邮件{} 没有附件(fileName={},disposition={}),下载不了附件内容!", subject, fileName, disposition);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void reMultipart(String account, String subject, Date emailDate, Multipart multipart, List<EmailContentInfoDTO> emailContentInfoDTOList) throws Exception {
|
|
|
+ private void reMultipart(String account, String subject, Date emailDate, Multipart multipart,
|
|
|
+ List<EmailContentInfoDTO> emailContentInfoDTOList) throws Exception {
|
|
|
for (int i = 0; i < multipart.getCount(); i++) {
|
|
|
Part bodyPart = multipart.getBodyPart(i);
|
|
|
if (bodyPart.getContent() instanceof Multipart mp) {
|