JavaMail 1.4.4 - Java 1.4 및 Java 1.6에서 일부 POP3 메시지를 구문 분석하는 이상한 문제가 있습니다.JavaMail이 일부 POP3 메시지 헤더를 잃어서 multipart/mixed를 text/plain으로 처리합니다.
Windows 2003 POP3 서비스 사서함에서 검색 한 com.sun.mail.pop3.POP3Message
을 구문 분석합니다. getAllHeaderLines()
Enumeration을 거쳐 소스 메시지와 비교해 보면 Reply-To 헤더가 중간 전자 메일 주소에서 잘리고 나머지 모든 헤더가 누락되어 있음을 알 수 있습니다 (특히 Subject, To, In-Reply-To, MIME-Version). , Contact-Type, Return-Path 및 X-OriginalArrivalTime)가 포함됩니다. getContentType()
메서드는 text/plain을 반환하고 getContent()
메서드는 전체 multipart/mixed 메시지를 String으로 반환합니다.
JavaMail 디버그 모드를 켜면 메시지에 대한 모든 것이 정상적으로 보이며 원본 메시지 파일과 일치합니다.
모든 아이디어를 얻을 수 있습니다. 여기
Message-ID: <[email protected]>
Date: Sun, 26 Aug 2012 08:38:52 -0700
From: Secure Comfort <[email protected]>
Reply-To: Secure Comfort <[email protected]>
Subject: Language & Transportation Service
To: "[email protected]"
< xxxxxx @ xxxxxx.com>
In-Reply-To: <[email protected]>
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="1816409020-1433069823-1345995533=:54860"
Return-Path: [email protected]
X-OriginalArrivalTime: 26 Aug 2012 15:39:22.0287 (UTC) FILETIME=[F6D67BF0:01CD83A0]
--1816409020-1433069823-1345995533=:54860
Content-Type: multipart/alternative;
boundary="1816409020-520494517-1345995533=:54860"
--1816409020-520494517-1345995533=:54860
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
는 MimeMessage를위한 게터의 대부분은 다음과 같습니다 : 여기
는 POP3 사서함에서 소스 메시지 파일의 코드 조각입니다Content ID=null
Content Language=null
Content MD5=null
Content Type=text/plain
Data Handler=javax.mail.internet.MimeBodyPart$MimePartDataHandler
Description=null
Disposition=null
Encoding=null
File Name=null
Line Count=-1
Message ID=<[email protected]>
Received Date=null
Sent Date=Sun Aug 26 10:38:52 CDT 2012
Size=7480850
Subject=null
나는 같은 문제가 있었고 최신 'javax.mail-api'1.5.3으로 업그레이드 만 해결되었다. – user1516873