Content-type multipart/voice is coming as text/plain ( getContentType() )
Even though the actual E-mail message has the content type as multipart/Voice as shown below the getContentType() is shown as
the following.
getContentType()
TEXT/PLAIN; charset=us-ascii
THE ACTUAL MESSAGE :
# cat 2.msgReturn-path: <[email protected]>
Received: from localhost.localdomain ([192.18.74.46])
by millerite.red.iplanet.com
(Sun Java(tm) System Messaging Server 7.0-99.01 64bit (built Aug 12 2008))
with ESMTP id <[email protected]> for
[email protected]; Mon, 15 Sep 2008 15:42:28 -0700 (PDT)
Original-recipient: rfc822;user51
Date-warning: Date header was inserted by millerite.red.iplanet.com
Date: Mon, 15 Sep 2008 15:42:28 -0700 (PDT)
Message-id: <[email protected]>
From: [email protected]
To: [email protected]
Content-type: Multipart/voice
X-Message-Type: Multipart/voice
Subject: Test Mail
START
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB
1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB
1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB
1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB
1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB
1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB
1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB
1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB
1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB
1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB
1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB
1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB
1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB
1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB
1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB
1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB
1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB
1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB
1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB
1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB
1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB1KB
JAVAJAVAJAVAJAVAJAVAJAVAJAVAJAVAJAVAJAVAJAVAJAVAJAVAJAVAJAVAJAVA
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
END
Mon Sep 15 17:50:43 PDT 2008
DEBUG: JavaMail version 1.4.1
DEBUG: not loading file: /usr/jdk/instances/jdk1.5.0/jre/lib/javamail.providers
DEBUG: java.io.FileNotFoundException: /usr/jdk/instances/jdk1.5.0/jre/lib/javamail.providers (No such file or directory)
DEBUG: !anyLoaded
DEBUG: not loading resource: /META-INF/javamail.providers
DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
DEBUG: Tables of loaded providers
DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]}
DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]}
DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
DEBUG: !anyLoaded
DEBUG: not loading resource: /META-INF/javamail.address.map
DEBUG: not loading file: /usr/jdk/instances/jdk1.5.0/jre/lib/javamail.address.map
DEBUG: java.io.FileNotFoundException: /usr/jdk/instances/jdk1.5.0/jre/lib/javamail.address.map (No such file or directory)DEBUG: getProvider() returning javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc]
DEBUG: mail.imap.fetchsize: 16384
* OK [CAPABILITY IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ NAMESPACE UIDPLUS CHILDREN BINARY UNSELECT SORT CATENATE URLAUTH LANGUAGE ESEARCH ESORT THREAD=ORDEREDSUBJECT THREAD=REFERENCES ENABLE CONTEXT=SEARCH CONTEXT=SORT WITHIN SASL-IR SEARCH_RES XSENDER X-NETSCAPE XSERVERINFO X-SUN-SORT ANNOTATE-EXPERIMENT-1 X-UNAUTHENTICATE X-SUN-IMAP X-ANNOTATEMORE XUM1 STARTTLS AUTH=DIGEST-MD5 AUTH=PLAIN AUTH=CRAM-MD5] millerite.red.iplanet.com IMAP4 service (Sun Java(tm) System Messaging Server 7.0-99.01 64bit (built Aug 12 2008))
IMAP DEBUG: AUTH: DIGEST-MD5
IMAP DEBUG: AUTH: PLAIN
IMAP DEBUG: AUTH: CRAM-MD5
A0 CAPABILITY
* CAPABILITY IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ NAMESPACE UIDPLUS CHILDREN BINARY UNSELECT SORT CATENATE URLAUTH LANGUAGE ESEARCH ESORT THREAD=ORDEREDSUBJECT THREAD=REFERENCES ENABLE CONTEXT=SEARCH CONTEXT=SORT WITHIN SASL-IR SEARCH_RES XSENDER X-NETSCAPE XSERVERINFO X-SUN-SORT ANNOTATE-EXPERIMENT-1 X-UNAUTHENTICATE X-SUN-IMAP X-ANNOTATEMORE XUM1 STARTTLS AUTH=DIGEST-MD5 AUTH=PLAIN AUTH=CRAM-MD5
A0 OK Completed
IMAP DEBUG: AUTH: DIGEST-MD5
IMAP DEBUG: AUTH: PLAIN
IMAP DEBUG: AUTH: CRAM-MD5
DEBUG: protocolConnect login, host=millerite.red.iplanet.com, user=user51, password=<non-null>
A1 AUTHENTICATE PLAIN
+
dXNlcjUxAHVzZXI1MQB1c2VyNTE=
A1 OK User logged in
A2 CAPABILITY
* CAPABILITY IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ NAMESPACE UIDPLUS CHILDREN BINARY UNSELECT SORT CATENATE URLAUTH LANGUAGE ESEARCH ESORT THREAD=ORDEREDSUBJECT THREAD=REFERENCES ENABLE CONTEXT=SEARCH CONTEXT=SORT WITHIN SASL-IR SEARCH_RES XSENDER X-NETSCAPE XSERVERINFO X-SUN-SORT ANNOTATE-EXPERIMENT-1 X-UNAUTHENTICATE X-SUN-IMAP X-ANNOTATEMORE XUM1 STARTTLS
A2 OK Completed
A3 LIST "" INBOX
* LIST (\NoInferiors) "/" INBOX
A3 OK Completed
Sep 15, 2008 5:50:47 PM com.sun.comms.iss.indexapi.parser.EmailParser bootstrapEvent
INFO: [ Begin: Mon Sep 15 17:50:47 PDT 2008 ] Processing User - user51 On Host - millerite.red.iplanet.com
DEBUG: connection available -- size: 1
A4 EXAMINE INBOX
* FLAGS (\Answered \Flagged \Draft \Deleted \Seen NonJunk)
* OK [PERMANENTFLAGS ()]
* 5 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1217896692]
* OK [UIDNEXT 7]
A4 OK [READ-ONLY] Completed
A5 FETCH 1 (BODYSTRUCTURE)
* 1 FETCH (BODYSTRUCTURE ("TEXT" "PLAIN" ("CHARSET" "us-ascii") NIL NIL "7BIT" 0 0 NIL NIL NIL NIL))
A5 OK Completed
A6 FETCH 1 (UID)
* 1 FETCH (UID 2)
A6 OK Completed
A7 FETCH 1 (ENVELOPE INTERNALDATE RFC822.SIZE)
* 1 FETCH (INTERNALDATE "15-Sep-2008 15:42:29 -0700" RFC822.SIZE 2257 ENVELOPE ("Mon, 15 Sep 2008 15:42:28 -0700 (PDT)" "Test Mail" ((NIL NIL "user35" "red.iplanet.com")) ((NIL NIL "user35" "red.iplanet.com")) ((NIL NIL "user35" "red.iplanet.com")) ((NIL NIL "user51" "red.iplanet.com")) NIL NIL NIL "<[email protected]>"))
A7 OK Completed
A8 FETCH 1 (FLAGS)
* 1 FETCH (FLAGS (\Seen NonJunk))
A8 OK Completed
A9 CLOSE
A9 OK Completed
DEBUG: added an Authenticated connection -- size: 1
A10 LIST "" INBOX
* LIST (\NoInferiors) "/" INBOX
A10 OK Completed
DEBUG: connection available -- size: 1
A11 EXAMINE INBOX
* FLAGS (\Answered \Flagged \Draft \Deleted \Seen NonJunk)
* OK [PERMANENTFLAGS ()]
* 5 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1217896692]
* OK [UIDNEXT 7]
A11 OK [READ-ONLY] Completed
A12 FETCH 2:5 (BODYSTRUCTURE)
* 2 FETCH (BODYSTRUCTURE ("TEXT" "PLAIN" ("CHARSET" "us-ascii") NIL NIL "7BIT" 0 0 NIL NIL NIL NIL))
* 3 FETCH (BODYSTRUCTURE ("TEXT" "PLAIN" ("CHARSET" "us-ascii") NIL NIL "7BIT" 0 0 NIL NIL NIL NIL))
* 4 FETCH (BODYSTRUCTURE ("TEXT" "PLAIN" ("CHARSET" "us-ascii") NIL NIL "7BIT" 0 0 NIL NIL NIL NIL))
* 5 FETCH (BODYSTRUCTURE ("TEXT" "PLAIN" ("CHARSET" "us-ascii") NIL NIL "7BIT" 0 0 NIL NIL NIL NIL))
A12 OK Completed
A13 FETCH 2 (ENVELOPE INTERNALDATE RFC822.SIZE)
* 2 FETCH (INTERNALDATE "15-Sep-2008 15:42:29 -0700" RFC822.SIZE 2257 ENVELOPE ("Mon, 15 Sep 2008 15:42:28 -0700 (PDT)" "Test Mail" ((NIL NIL "user35" "red.iplanet.com")) ((NIL NIL "user35" "red.iplanet.com")) ((NIL NIL "user35" "red.iplanet.com")) ((NIL NIL "user51" "red.iplanet.com")) NIL NIL NIL "<[email protected]>"))
A13 OK Completed
A14 FETCH 2 (UID)
* 2 FETCH (UID 3)
A14 OK Completed
A15 FETCH 2 (FLAGS)
* 2 FETCH (FLAGS (\Seen NonJunk))
A15 OK Completed
A16 FETCH 3 (ENVELOPE INTERNALDATE RFC822.SIZE)
* 3 FETCH (INTERNALDATE "15-Sep-2008 15:42:29 -0700" RFC822.SIZE 2257 ENVELOPE ("Mon, 15 Sep 2008 15:42:28 -0700 (PDT)" "Test Mail" ((NIL NIL "user35" "red.iplanet.com")) ((NIL NIL "user35" "red.iplanet.com")) ((NIL NIL "user35" "red.iplanet.com")) ((NIL NIL "user51" "red.iplanet.com")) NIL NIL NIL "<[email protected]>"))
A16 OK Completed
A17 FETCH 3 (UID)
* 3 FETCH (UID 4)
A17 OK Completed
A18 FETCH 3 (FLAGS)
* 3 FETCH (FLAGS (\Seen NonJunk))
A18 OK Completed
A19 FETCH 4 (ENVELOPE INTERNALDATE RFC822.SIZE)
* 4 FETCH (INTERNALDATE "15-Sep-2008 15:42:29 -0700" RFC822.SIZE 2257 ENVELOPE ("Mon, 15 Sep 2008 15:42:28 -0700 (PDT)" "Test Mail" ((NIL NIL "user35" "red.iplanet.com")) ((NIL NIL "user35" "red.iplanet.com")) ((NIL NIL "user35" "red.iplanet.com")) ((NIL NIL "user51" "red.iplanet.com")) NIL NIL NIL "<[email protected]>"))
A19 OK Completed
A20 FETCH 4 (UID)
* 4 FETCH (UID 5)
A20 OK Completed
A21 FETCH 4 (FLAGS)
* 4 FETCH (FLAGS (\Seen NonJunk))
A21 OK Completed
A22 FETCH 5 (ENVELOPE INTERNALDATE RFC822.SIZE)
* 5 FETCH (INTERNALDATE "15-Sep-2008 15:42:29 -0700" RFC822.SIZE 2257 ENVELOPE ("Mon, 15 Sep 2008 15:42:29 -0700 (PDT)" "Test Mail" ((NIL NIL "user35" "red.iplanet.com")) ((NIL NIL "user35" "red.iplanet.com")) ((NIL NIL "user35" "red.iplanet.com")) ((NIL NIL "user51" "red.iplanet.com")) NIL NIL NIL "<[email protected]>"))
A22 OK Completed
A23 FETCH 5 (UID)
* 5 FETCH (UID 6)
A23 OK Completed
A24 FETCH 5 (FLAGS)
* 5 FETCH (FLAGS (\Seen))
A24 OK Completed
A25 CLOSE
A25 OK Completed
DEBUG: added an Authenticated connection -- size: 1
A26 LIST "" INBOX
* LIST (\NoInferiors) "/" INBOX
A26 OK Completed
IMAP DEBUG: IMAPProtocol noop
A27 NOOP
A27 OK Completed
A28 LOGOUT
* BYE LOGOUT received
A28 OK Completed
DEBUG: IMAPStore connection dead
DEBUG: IMAPStore cleanup, force false
DEBUG: IMAPStore cleanup done
Mon Sep 15 17:50:47 PDT 2008Edited by: SpaceShuttle on Sep 15, 2008 5:59 PM
Edited by: SpaceShuttle on Sep 15, 2008 6:00 PM
Similar Messages
-
Unable to add Content-Type=multipart/related; type="text/xml";
hi all
am trying to add the following to my soap message that include attachment
but its not working
Content-Type=multipart/related; type="text/xml";
boundary="----=_Part_0_14732323.1039686671216";
Content-Length=4259;
can any body help plzzzzzzzzHello again,
My solution works and does not work. Content type is ok, but strange characters appear to the end of the attachment data.
Like this
...</E1EDS01></IDOC></ORDERS01>H úãž6×½ ã½5Õ×¼ÛgžÛNÝ}þ[ëMu201E
Where did these come from? I tested in a way that I changed the ContentType back to application/xml and attachment is fine again.
Regards,
Pekka -
I have a Macbook Air. I have MS office installed and work in Excel often with no issues. But When I download an excel spread sheet from a Ford web site I seem to be getting code and not the work sheet.
Example-
MIME-Version: 1.0
X-Document-Type: Workbook
Content-Type: multipart/related; boundary="====Boundary===="
--====Boundary====
Content-Location: file:///C:/HOLD.XHT
Content-Transfer-Encoding: 8bit
Content-Type: text/html; charset="utf-8"
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<HEAD>
<meta name="Excel Workbook Frameset">
<xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:Name>BTB</x:Name>
<x:WorksheetSource HRef="./IBIT0001.xht"/>
</x:ExcelWorksheet>
<x:ExcelWorksheet>
<x:Name>GSM</x:Name>
<x:WorksheetSource HRef="./IBIT0002.xht"/>
</x:ExcelWorksheet>
<x:ExcelWorksheet>
<x:Name>RODetail</x:Name>
<x:WorksheetSource HRef="./IBIT0003.xht"/>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
</x:ExcelWorkbook>
</xml>
</HEAD>
</HTML>
--====Boundary====
Content-Location: file:///C:/IBIT0001.xht
Content-Transfer-Encoding: 8bit
Content-Type: text/html; charset="utf-8"
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<HEAD>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<style>
<!--table
{mso-displayed-decimal-separator:"\.";
mso-displayed-thousand-separator:"\,";}
@page
{margin:1.0in .75in 1.0in .75in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-page-orientation:landscape;}
tr
{mso-height-source:auto;}
col
{mso-width-source:auto;}
br
{mso-data-placement:same-cell;}
.style21
{color:blue;
font-size:10.0pt;
font-weight:400;
font-style:normal;
text-decoration:underline;
text-underline-style:single;
font-family:Arial;Try search/ask in the forum devoted entirely to Excel issues:
http://answers.microsoft.com/en-us/mac/forum/macexcel -
How to Read a Message with Content Type multipart/alternative
Hi ,
I need to write a POP3 Client to read email message ..but some times the messages comes with content type multipart/alternative
how to parse it and read only one of the content :
for example :
This is a multi-part message in MIME format.
------=_NextPart_000_12C25_01C6B64F.09226B00
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Assignment to workgroup Name 1 : L2 SD Service Delivery Apps Spt
Open CI Search Code : HPSD
Description : tesat
General Information :
Is the workgroup owner Aware of the addition to Workgroup : Yes
Workgroup to be added :
L2 SD Service Delivery Apps Spt
------=_NextPart_000_12C25_01C6B64F.09226B00
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<br><P>Assignment to workgroup Name 1 : L2 SD Service Delivery Apps =
Spt</P>
<P>Open CI Search Code : HPSD</P>
<P>Description : tesat</P>
<P>General Information :</P>
<P>Is the workgroup owner Aware of the addition to Workgroup : Yes</P>
<P>Workgroup to be added :</P>
<P>L2 SD Service Delivery Apps Spt</P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
------=_NextPart_000_12C25_01C6B64F.09226B00--
The Same message is in text as well as HTML so not sure how to read it .
currently my program is as follows
for (int i = 0; i < found.length; i++) {
Message m = found;
// Get some headers
Date date = m.getSentDate();
Address [] from = m.getFrom();
String subj = m.getSubject();
String mimeType = m.getContentType();
System.out.println(date + "\t" + from[0] + "\t" +
subj + "\t" + mimeType);
Object o = m.getContent();
if (o instanceof String) {
System.out.println("**This is a String Message**");
System.out.println((String)o);
} else if (o instanceof Multipart) {
System.out.print("**This is a Multipart Message. ");
Multipart mp = (Multipart)o;
int count3 = mp.getCount();
System.out.println("It has " + count3 +
" BodyParts in it**");
for (int j = 0; j < count3; j++) {
// Part are numbered starting at 0
BodyPart b = mp.getBodyPart(j);
String mimeType2 = b.getContentType();
System.out.println( "BodyPart " + (j + 1) +
" is of MimeType " + mimeType);
Object o2 = b.getContent();
if (o2 instanceof String) {
System.out.println("**This is a String BodyPart**");
System.out.println((String)o2);
} else if (o2 instanceof Multipart) {
System.out.print(
"**This BodyPart is a nested Multipart. ");
Multipart mp2 = (Multipart)o2;
int count2 = mp2.getCount();
System.out.println("It has " + count2 +
"further BodyParts in it**");
} else if (o2 instanceof InputStream) {
System.out.println(
"**This is an InputStream BodyPart**");
} //End of for
} else if (o instanceof InputStream) {
System.out.println("***********************************This is an InputStream message**");
InputStream is = (InputStream)o;
/* if(m.getContentType().equalsIgnoreCase("multipart/alternative")) {
MimeMultipart mp = new MimeMultipart();
// Assumes character content (not binary images)
} else {*/
BufferedReader reader
=new BufferedReader(new InputStreamReader(is));
String thisLine=reader.readLine();
while (thisLine!=null) {
System.out.println(thisLine);
thisLine=reader.readLine();
So when the Content TYpe is multipart/alternative it goes into InputStream message .
any help and ideas to handel such situations ?
Thanks
San
Message was edited by:
sanrosh_95Try reposting that with tags (replace the {'s with ['s).
Long story short, I think the FAQ and examples would go a long way towards explaining this, but you basically can check the content type, or check if the content contains parts, and parse each part separately. -
Match Content-Type: multipart/alternative;
Hello,
we´re doing a 30 Day trial and we´re trying to migrate functions out of our Surfcontrol EF to 2 Ironport C-150.
add_txt_footer:
[Sender is stadthalle.com] and
["Content-Type: multipart/alternative;" is not in Header] and
["aw:, re:, fwd:, wg:" is not in Subject] and
["7999979" is not in Body] and
[Message < 50kBytes] then add txtfooter
add_html_footer:
[Sender is stadthalle.com] and
["Content-Type: multipart/alternative;" is in Header] and
["aw:, re:, fwd:, wg:" is not in Subject] and
["7999979" is not in Body] and
[Message < 50kBytes] then add htmlfooter
- how can we do that?
Current situation:
add_txt_footer: if (mail-from == "stadthalle.com$") AND (header("Content-Type:") != "multipart/alternative;") AND (body-size < 50000) { add-footer("txtfooter"); }
allways matches, so RTF and HTML Mails dont get the html footer
</PRE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<font face="Trebuchet MS"><strong>MASTERS OF DIRT:</strong>
<br>
21. + 22. Februar 2009 / Wiener Stadthalle
<br>
INFO: <a href="http://www.stadthalle.com">http://www.stadthalle.com</a> 01 / 79 999 79 </font>
</body>
</html>
<PRE>
any suggestion welcome!
KlemensHi Klemens,
I made some slight modifications to your posted filter, and tried out my versions on an IronPort, which good results.
There are other options you will probably want to add, such as including the name of the outgoing listener to keep messages from being "double-footered".
This is covered in a Knowledge Base article already: http://tinyurl.com/5gaj24
I created the following as message filters from the CLI.
addtxtfooter:
if(mail-from == "example.com$") AND (header("Content-Type") != "multipart/alternative") AND (body-size < 50000)
add-footer("txtfooter");
addhtmlfooter:
if(mail-from == "example.com$") AND (header("Content-Type") == "multipart/alternative") AND (body-size < 50000)
add-footer("htmlfooter");
Hope that helps.
-whardison -
E-Mail recevier with Content-Type: multipart/mixed
Hi All,
I am working on proxy to Mail scenario, wherein Pi is receiving data from SAP over proxy, creating a csv of the data and sending it to recipient as the email with the attachment.
The User is saying that he wants the email content type as Multipart MIME format. I have searched on SDN and web, but couldnu2019t find how to implement in PI.Please provide your inputs.
Thanks in advance,
RuchiHi Ruchi,
You need to use Java Mapping or UDF to create Multipart/Mime
Check this excellent blog by stefan.
http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/6321
Also check this thread for your solution
http://forums.sdn.sap.com/message.jspa?tstart=0&messageID=945095 -
Can't read Messages with Content-Type multipart/mixed
For many years I have used „QuickMail Pro“, as my favorite Mail-Client. Now I had switch to Apple Mail. I hoped, to be more compatible to other „modern“ Mail-Clients. So could it be, that Apple Mail can not read Messages from Type <multipart/mixed>? I only see the Header-Information and instead of the Message-Text there is only an Error-Message:
<Diese E-Mail kann aufgrund ihrer Formatierung nicht angezeigt werden. Bitten Sie den Absender, Ihnen die E-Mail erneut in einem anderen Format bzw. mit einem anderen E-Mail-Programm zu senden.
multipart/mixed>
Did anyone know a simple Way, to read this Messages.
My old QuickMail has no Problem with this Type.Hi Ruchi,
You need to use Java Mapping or UDF to create Multipart/Mime
Check this excellent blog by stefan.
http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/6321
Also check this thread for your solution
http://forums.sdn.sap.com/message.jspa?tstart=0&messageID=945095 -
Hello,
How can I get the content type of an url (e.g. text/plain)?
thank you,
Peterjava.net.URL url = ...;
java.net.URLConnection conn = url.openConnection();
String contentType = conn.getContentType(); -
OSB defaulting Content-Type to "multipart/related" in case of attachments
I have scenario where I need to invoke a REST Webservice from OSB which accepts only media types which has "multipart/atom+xml". OSB is used for protocol transformation converting the SOAP request into the HTTP POST request with multipart. I have Proxy Service which will unwrap the message from the SOAP Body and post the same message into the payload of the Business Service and the attachment is passed 'as is' from the SOAP Service. The external REST Service Provider expects the media type to be "multipart/atom+xml", but in OSB when an attachment is present in the message, OSB is overrding the "Content-Type" proeprty to "multipart/related" inspite of me setting the "Content-Type" property of HTTP Transport Header in OSB and as result external RESTFUL Service is throwing "415-Unsupported Media Type" error. Below is the test results. One interesting thing is, it happens only when there is attachment present in the message. In case of a message which doesn't have attachment any "Content-Type" specified in the Transport Header is passed by the OSB to the external service. Any help is highly appreciated.
OSB Transport Header
Added the header <http:Content-Type>multipart/atom+xml</http:Content-Type>
Actual Raw Message
POST http://xxx7200:7004/XXXInterfaces/identify HTTP/1.1
Content-Type: multipart/related; type="text/plain"; start="<Root_-328322390>"; boundary=MIME_Boundary; charset=UTF-8
MIME-Version: 1.0
User-Agent: Java1.6.0_17
Host: xxx7200:7004
Accept: text/html, image/gif, image/jpeg, */*; q=.2
Proxy-Connection: Keep-Alive
Content-Length: 4823
Expected Raw Message
POST http://xxx7200:7004/XXXInterfaces/identify HTTP/1.1
Content-Type: multipart/atom+xml; boundary=MIME_Boundary;
User-Agent: Java1.6.0_17
Host: xxx7200:7004
Accept: text/html, image/gif, image/jpeg, */*; q=.2
Proxy-Connection: Keep-Alive
Content-Length: 4803
-KC
Edited by: 799459 on Apr 8, 2011 5:36 AM
Edited by: 799459 on Apr 8, 2011 7:02 AM
Edited by: 799459 on Apr 8, 2011 7:13 AM
Edited by: 799459 on Apr 8, 2011 7:14 AMHTTP content-type header has the following limitation as per osb doc.
Oracle Service Bus run time may overwrite these headers in the binding layer when preparing the message for dispatch. If these headers are modified, $inbound and $outbound are updated accordingly. So what you are seeing may be working as designed. Cant the remote service accept the multi part related content type set up by osb ? -
Invalid content type for SOAP: TEXT/HTML; HTTP 500 Internal Server Error
Hi,
I have this error on a SOAP Receiver Channel: invalid content type for SOAP: TEXT/HTML; HTTP 500 Internal Server Error
I've found several threads on SDN Forums about similar errors, but I did not find a solution for my problem yet.
I checked this blog: /people/shabarish.vijayakumar/blog/2008/01/08/troubleshooting--rfc-and-soap-scenarios-updated-on-20042009 Pt.6 applies to my situation, but the proposed solution doesn't solve the problem.
TRACE Messaging System
u2026
2011-06-06 10:59:41.822 Success Delivering to channel: CC_SOAP_RCV_XXX
2011-06-06 10:59:41.823 Success MP: entering1
2011-06-06 10:59:41.825 Success MP: processing local module localejbs/sap.com/com.sap.aii.af.soapadapter/XISOAPAdapterBean
2011-06-06 10:59:41.828 Success SOAP: request message entering the adapter with user J2EE_GUEST
2011-06-06 10:59:42.012 Error SOAP: call failed: java.io.IOException: invalid content type for SOAP: TEXT/HTML; HTTP 500 Internal Server Error
2011-06-06 10:59:42.014 Success SOAP: sending a delivery error ack ...
2011-06-06 10:59:42.014 Success SOAP: sent a delivery error ack
u2026
Message Details
Address http://aaa.bbb.be:54000/MessagingSystem/receive/AFW/XI
Credential PasswordCredential(PIISUSER):password=********
Transport Headers accept-encoding=gzip sap-xi-messageid=4DEA11FE90003094E10000000AE908B4 content-length=7520 http=POST host= aaa.bbb.be:54000 user-agent=SAP NetWeaver Application Server (1.0;711) content-type=multipart/related;boundary=SAP_4DEA47CEAD3A5138E10000000AE908B4_END;type="text/xml";start="" soapaction="http://sap.com/xi/XI/Message/30"
Configuration Details SOAP Communication Channel
SOAP Receiver Channel
No modules configured
Do not use SOAP Envelope -> NOT checked
If I type the target URL in browser it opens (no login required) and I see the available web services.
Anyone any idea what's the reason for this error?
Thanks in advance
Kind Regards
Edmond PaulussenHi Edmond,
We faced similar problem & found alternative.
Try out, if it works for u as well.
1) Use HTTP Adapter instead of SOAP.
Transport Protocol : HTTP 1.0
Message Protocol : XI Payload in HTTP Body
Adapter Engine : Integration Server
Addressing type : URL Address.
Target Host:
Service Number :
Path Prefix:
Authentication type : we hv used Ananymus login, as our login details in payload header.
Content Type : application/soap+xml;charset=UTF-8( this is IMP).
Header Fields.
Name value
Host target host
XI Payload Manipulation
XML Code : UTF-8
Hope, this helps...
-santosh. -
Unable to read email content of type multipart/mixed....
Hi i have written following code to read text content form the multipart email content type,
but when i say
if (content instanceof Multipart){
System.out.println("############ Content Type is Multipart ############ ");
messagePart = ((Multipart) content).getBodyPart(0);
}the flow is not going into the if condition,
bellow is the detailed code and the output in the console, you can check with the SOPs
Part messagePart = message;
content = messagePart.getContent();
System.out.println("############ : " + content);
System.out.println("############ START MESSAGE BODY ############");
System.out.println(content);
System.out.println("############ END MESSAGE BODY ############");
if (content instanceof Multipart){
System.out.println("############ Content Type is Multipart ############ ");
messagePart = ((Multipart) content).getBodyPart(0);
String contentType = messagePart.getContentType();
System.out.println("############ CONTENT TYPE : " + contentType);
System.out.println("############ CONTENT TYPE : " + contentType);
if (contentType.startsWith("text/plain")) {
System.out.println("############ Content Type is text/plain ############");
InputStream is = messagePart.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
String thisLine = reader.readLine();
while (thisLine != null) {
actualMsg = actualMsg + thisLine + ".";
thisLine = reader.readLine();
System.out.println("############ SMS CONTENT :" + actualMsg);
System.out.println("/**********************Passing to E2SConverter********************/");
And the output for the same
Stack Trace*** Check for new mails on Mail Server for Processing ***
########## Unread Msg Count : 1
########## FROM : [email protected]
########## SUBJECT : RE: SMS-5000-9969413222-S1221654991804 [T20080917000CS010Z246]
**************** Checking Subject Line ****************
******* GO AHEAD IS TRUE : EMAIL TO SMS CONVERTER *******
############ : javax.mail.internet.MimeMultipart@1a2760f
############ START MESSAGE BODY ############
javax.mail.internet.MimeMultipart@1a2760f
############ END MESSAGE BODY ############
############ CONTENT TYPE : multipart/mixed; boundary=22902610.1221655198503.JavaMail.javamailuser.localhost
############ SMS CONTENT :
/**********************Passing to E2SConverter********************/
Please help me for the same.. its bit urgent...
Thanks And Regards,
Amie...Yes,
It's going into the if if block, but its giving me ClassCastException
System.out.println("******* GO AHEAD IS TRUE : EMAIL TO SMS CONVERTER ******* ");
Part messagePart = message;
content = messagePart.getContent();
System.out.println("############ : " + content);
System.out.println("############ START MESSAGE BODY ############");
System.out.println(content);
System.out.println("############ END MESSAGE BODY ############");
if (messagePart.isMimeType("multipart/*")) {
System.out.println("############ Content Type is Multipart ############ ");
messagePart = ((Multipart) content).getBodyPart(0); //GIVES EXCEPTION : ClassCastException at this line...
String contentType = messagePart.getContentType();
System.out.println("############ CONTENT TYPE : " + contentType);
See the Stack Trace..TAconnVect.size()25
*** Check for new mails on Mail Server for Processing ***
########## Unread Msg Count : 2
########## FROM : [email protected]
########## SUBJECT : SMS-5000-9969413222-S1221713640885 [T200809180003S070]
########## FROM : [email protected]
########## SUBJECT : SMS-5000-9969413222-S1221713740897 [T200809180004S070]
**************** Checking Subject Line ****************
******* GO AHEAD IS TRUE : EMAIL TO SMS CONVERTER *******
############ : javax.mail.internet.MimeMultipart@1f7be7b
############ START MESSAGE BODY ############
javax.mail.internet.MimeMultipart@1f7be7b
############ END MESSAGE BODY ############
############ Content Type is Multipart ############
java.lang.ClassCastException: javax.mail.internet.MimeMultipart
at com.interactcrm.SMSConverterClass.PollEmail.CheckEmails(PollEmail.java:327)
at com.interactcrm.SMSConverterClass.PollEmail.run(PollEmail.java:98)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)
- INFO : readMessage Checking for new messages in inbound table of ta database
TAconnVect.size()25
TAconnVect.size()25
and Bellow is the internet header of the mail which i am trying to read.Received: from grameenphone.com ([10.10.29.153]) by neptune.grameenphone.com with Microsoft SMTPSVC(6.0.3790.3959);
Thu, 18 Sep 2008 10:55:52 +0600
Date: Thu, 18 Sep 2008 04:55:52 GMT
From: [email protected]
Subject: =?us-ascii?B?U01TLTUwMDAtOTk2OTQxMzIyMi1TMTIyMTcxMzc0MDg5NyBbVDIwMDgwOTE4MDAwNFMwNzBd?=
To: [email protected]
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="20238918.1221131600666.JavaMail.SYSTEM.ipcc-test3"
Return-Path: [email protected]
Message-ID: <[email protected]>
X-OriginalArrivalTime: 18 Sep 2008 04:55:52.0114 (UTC) FILETIME=[D35D2120:01C9194A]
Edited by: Amie on Sep 18, 2008 10:29 AM
Edited by: Amie on Sep 18, 2008 10:36 AM -
Attachment without multipart content type
Hello,
My application receives mails sent from some different customers and parses the mail's attachments. The problem is that all these customers send their mails in a very different ways. Some of them send mails with "Content-Type: multipart/mixed;" header while some others send mail with the following headers (among some other):
MIME-Version: 1.0
Content-Type: application/xml
Date: Tue, 11 Feb 2014 18:33:26 +0000
From: <[email protected]>
Message-ID: <1392143606.220.1@cls0361>
Subject: orders000005311382.xml
To: <[email protected]>
There is no "Content-Type: multipart/mixed;" header at all. When I look at these messages with MS Outlook I can see that they have proper attachements.
Now I have 2 problems:
1. I would like to produce such an email myself since resending the received emails changes the message headers. There are lots of examples how to send a message with an attachment in Java with MimeMultipart object (this produces "Content-Type: multipart/mixed;") but I could not find one which sends the message with "Content-Type: application/xml" header only without any multipart header. I suspect that there are some specific applications which send mails in that way - not standard mail clients.
2. I would like to get the attachment of a received mail with "Content-Type: application/xml" header. The following code works for "Content-Type: multipart/mixed;" only:
public void invoke() throws Exception {
/* Available Variables: DO NOT MODIFY
In : String mimeMessage
In : String encoding
Out : String[] mimeParts
* Available Variables: DO NOT MODIFY *****/
javax.mail.util.ByteArrayDataSource ds = new javax.mail.util.ByteArrayDataSource(mimeMessage, "multipart/mixed");
javax.mail.internet.MimeMultipart mm = new javax.mail.internet.MimeMultipart(ds);
java.util.ArrayList<String> al = new java.util.ArrayList<String>();
getAttachements(mm, al, 1);
mimeParts = new String[0];
mimeParts = al.toArray(mimeParts);
private void getAttachements(javax.mail.internet.MimeMultipart mm, ArrayList<String> al, int depth) throws Exception {
if (depth > 9) {
return;
int mimePartsCount = mm.getCount();
for (int i = 0; i < mimePartsCount; i++){
javax.mail.internet.MimeBodyPart mbp = (javax.mail.internet.MimeBodyPart)mm.getBodyPart(i);
//System.out.println(depth + ": " + mbp + " " + mbp.getContentType() + " " + mbp.getContentID() + " " + mbp.getDisposition());
if(mbp.getContentType().startsWith("multipart")){
javax.mail.util.ByteArrayDataSource ds2 = new javax.mail.util.ByteArrayDataSource(mbp.getInputStream(), "multipart/mixed");
javax.mail.internet.MimeMultipart mm2 = new javax.mail.internet.MimeMultipart(ds2);
getAttachements(mm2, al, depth+1);
} else {
if (mbp.getDisposition() != null && mbp.getDisposition().startsWith("attachment") && !mbp.getContentType().contains("signature")){
BufferedReader br = new BufferedReader(new InputStreamReader(mbp.getInputStream(),encoding));
String s = br.readLine();
StringBuffer sb = new StringBuffer();
while (s != null) {
sb.append(s);
s = br.readLine();
al.add(sb.toString());
Could anyone suggest anything which may be helpful for resolving 1 or 2?
Best regardsYou are right! parsing of such not-multipart mail may look like that:
if (contentType.startsWith("application/xml")) {
//just a plain attachement which is a mail's content and not a multipart.
mimeParts = new String[1];
//according to RFC 2822 empty line separates headers from the body
mimeParts[0] = mimeMessage.substring(mimeMessage.indexOf("\n\r")).trim();
} else {
//multipart mail
javax.mail.util.ByteArrayDataSource ds = new javax.mail.util.ByteArrayDataSource(mimeMessage, "multipart/mixed");
javax.mail.internet.MimeMultipart mm = new javax.mail.internet.MimeMultipart(ds);
java.util.ArrayList<String> al = new java.util.ArrayList<String>();
getAttachements(mm, al, 1);
mimeParts = new String[0];
mimeParts = al.toArray(mimeParts);
Thanks! -
DeliveryException: invalid content type for SOAP: TEXT/PLAIN; HTTP 302 Move
Hi everyone,
Hello all,
I have an RFC->XI->Web Service (SOAP) synchronous scenario.
I'm trying to send a message from the the RFC, and in the message monitoring (SXMB_MONI) I'm getting this error message:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!-- Inbound Message
-->
<SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
<SAP:Category>XIAdapterFramework</SAP:Category>
<SAP:Code area="MESSAGE">GENERAL</SAP:Code>
<SAP:P1 />
<SAP:P2 />
<SAP:P3 />
<SAP:P4 />
<SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException: invalid content type for SOAP: TEXT/PLAIN; HTTP 302 Moved Temporarily</SAP:AdditionalText>
<SAP:ApplicationFaultMessage namespace="" />
<SAP:Stack />
<SAP:Retry>M</SAP:Retry>
</SAP:Error>
I have as the TARGET URL: http://webservices.iter.dk/calculator.asmx?WSDL
SOAP ACTION: http://www.iter.dk/webservices/calculator.asmx/Add
As the content type in the WSDL file: application/text
What could be wrong? thanks...
FelipeHi Felipe
This i think is due to incorrect address or redirection failure which is one of the major reason for 302 as per my knowledge.
You try to post the content and test it without using XI. Download SOAP UI and test it once and let me know
http://www.soapui.org/
helpful blog
Troubleshooting - RFC and SOAP scenarios *** Updated on 20/04/2009 ***
Thanks
Gaurav -
What is the content type for a plain text document.
Hello :)
I want to generate a plain text document for the user to either see, or to save to disk directly. What do I out for the setContentType MIME type for this?
Thanks
Jeff.text/plain
zakir -
Oracle Service Bus: Content Type is defaulted to "mutlipart/related"
I have scenario where I need to invoke a REST Webservice from OSB which accepts only media types which has "multipart/atom+xml". OSB is used for protocol transformation converting the SOAP request into the HTTP POST request with multipart. I have Proxy Service which will unwrap the message from the SOAP Body and post the message via Business Service and the attachment is passed 'as is' from the SOAP Service. The external REST Service Provider expects the media type to be "multipart/atom+xml", but in OSB when an attachment is present in the message, OSB is overrding the "Content-Type" property to "multipart/related" inspite of me setting the "Content-Type" property of HTTP Transport Header in OSB and as result external RESTFUL Service is throwing "415-Unsupported Media Type" error. Below is the test results. One interesting thing is, it happens only when there is attachment present in the message. In case of a message which doesn't have any attachment "Content-Type" specified in the Transport Header is passed by the OSB to the external service. Any help is highly appreciated.
OSB Transport Header
Added the header <http:Content-Type>multipart/atom+xml</http:Content-Type>
Actual Raw Message
POST http://xxx7200:7004/XXXInterfaces/identify HTTP/1.1
Content-Type: multipart/related; type="text/plain"; start="<Root_-328322390>"; boundary=MIME_Boundary; charset=UTF-8
MIME-Version: 1.0
User-Agent: Java1.6.0_17
Host: xxx7200:7004
Accept: text/html, image/gif, image/jpeg, /; q=.2
Proxy-Connection: Keep-Alive
Content-Length: 4823
Expected Raw Message
POST http://xxx7200:7004/XXXInterfaces/identify HTTP/1.1
Content-Type: multipart/atom+xml; boundary=MIME_Boundary;
User-Agent: Java1.6.0_17
Host: xxx7200:7004
Accept: text/html, image/gif, image/jpeg, /; q=.2
Proxy-Connection: Keep-Alive
Content-Length: 4803
-KCThere is no explicit option to disable the check on the XML content.
But the you can use Messaging Service of type Text request which will consider the data as string and so there will be no check.
If you want to use WSDL/AnyXML/AnySOAP proxies, the XML check is always carried when the $body varaible is not checked/modified when content streaming is enabled while creating the proxy. I'm quite sure HTTP transport supports content streaming and the stream from the input is directly given to BS with out realizing the XML. Only short coming is it should be a pure pass through and no data enrichment and any action in pipeline that requires realizing the XML from the stream.
Let me know if this helps.
Thanks
Manoj
Maybe you are looking for
-
External HD issue. Finder cannot complete the operation because some data..
Last night I had a drive throw the error "finder cannot complete the operation because some data in "<file>" could not be read or written. Error code-36". I thought it was a bad disk. Then tonight I plugged in a flash drive, formatted it on the machi
-
TS1424 New iTunes card, already been redeemed.
I tried to redeem a new iTunes card, I get a message that it has already been redeemed. It was in a sealed pack with the scratch off seal intact, what happened?
-
Hi Is it possible to tag a portion of text, so a Text or Word object without it sitting in a Story? Something like this. var app:Application = InDesign.app; var doc:Document = app.activeDocument; var root:XMLElement = doc.xmlElements.firstItem() var
-
Help identifying a powerbook model
hi there could someone help me identify a powerbook for me i found on ebay the ad says its a 12 inch but i can tell it isnt because i already own a 12 inch g4 and can somebody tell me what year and screen size it is please? http://www.ebay.co.uk/itm/
-
How to make Model Dialogs for erroe messages
Sir iwant to make a Dialog or JOption Pane like a round rectangle with yellow background show the error messages in my application like xp messages when we entered a wrong password and also want to underline some text in it. how can i do this job plz