我有以下MIME消息:MIME郵件無法解析
Return-Path: <[email protected]>
X-Original-To: [email protected]
Delivered-To: [email protected]
Received: from localhost [127.0.0.1]
by unify-prod with POP3 (fetchmail-6.3.21)
for <[email protected]> (single-drop); Mon, 03 Aug 2015 12:42:24+0000 (UTC)
Received: from testdomain.com (testdomain.com [192.69.176.183])
by unify.test.com (Postfix) with ESMTPS id AA3874330B
for <[email protected]>; Mon, 3 Aug 2015 12:42:23 +0000 (UTC)
Received: from test.call (test.call [10.3.1.49])
by test.com (Postfix) with ESMTP id 56EC73BA8C4
for <[email protected]>; Mon, 3 Aug 2015 12:42:23 +0000 (UTC)
Date: Mon, 3 Aug 2015 12:42:23 +0000 (UTC)
From: [email protected]
To: [email protected]
Message-ID: <[email protected]>
Subject: Update
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
|0004625641|
|630805367|
|NA14220388|
|03.08.2015 14:42:23|
||
我想這個代碼來解析Grails的消息:
InputStream mailFileInputStream = new FileInputStream("/home/peter/test.msg");
Properties props = new Properties();
Session session = Session.getDefaultInstance(props, null);
MimeMessage message = new MimeMessage(session, mailFileInputStream);
MimeMessageParser parser = new MimeMessageParser(message)
parser.parse()
def data = [:]
data.from = parser.getFrom()
data.to = parser.getTo()
data.replyTo = parser.getReplyTo()
data.html = parser.getHtmlContent()
data.plain = parser.getPlainContent()
data.subject = parser.getSubject()
data.attachments = parser.getAttachmentList()
但沒有正確解析的消息。整個信息都在簡單的內容中。這條消息有什麼問題?
最好的問候, 彼得