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!
Klemens

Hi 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

Similar Messages

  • 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_95

    Try 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.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • 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===="

    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

  • 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

  • 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 plzzzzzzzz

    Hello 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

  • 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,
    Ruchi

    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

  • 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

  • How does JavaMail handle Multipart/alternative

    There is this content-type called multipart/alternative, we are planning on indexing e-mails. But when the content-type is of type multipart/alternative
    then we need to index either parts but not both. Is there is any way I can handle this in javaMail i.e ask it to give me only one part ?
    _Thx
    *7.2.3 The Multipart/alternative subtype*
    The multipart/alternative type is syntactically identical to multipart/mixed, but the semantics are different. In particular, each of the parts is an "alternative" version of the same information. User agents should recognize that the content of the various parts are interchangeable. The user agent should either choose the "best" type based on the user's environment and preferences, or offer the user the available alternatives. In general, choosing the best type means displaying only the LAST part that can be displayed. This may be used, for example, to send mail in a fancy text format in such a way that it can easily be displayed anywhere:
    From: Nathaniel Borenstein <[email protected]>
    To: Ned Freed <[email protected]>
    Subject: Formatted text mail
    MIME-Version: 1.0
    Content-Type: multipart/alternative; boundary=boundary42
    --boundary42
    Content-Type: text/plain; charset=us-ascii
    ...plain text version of message goes here....
    --boundary42
    Content-Type: text/richtext
    .... richtext version of same message goes here ...
    --boundary42
    Content-Type: text/x-whatever
    .... fanciest formatted version of same message goes here
    boundary42
    In this example, users whose mail system understood the "text/x-whatever" format would see only the fancy version, while other users would see only the richtext or plain text version, depending on the capabilities of their system.
    In general, user agents that compose multipart/alternative entities should place the body parts in increasing order of preference, that is, with the preferred format last. For fancy text, the sending user agent should put the plainest format first and the richest format last. Receiving user agents should pick and display the last format they are capable of displaying. In the case where one of the alternatives is itself of type "multipart" and contains unrecognized sub-parts, the user agent may choose either to show that alternative, an earlier alternative, or both.
    NOTE: From an implementor's perspective, it might seem more sensible to reverse this ordering, and have the plainest alternative last. However, placing the plainest alternative first is the friendliest possible option when mutlipart/alternative entities are viewed using a non-MIME- compliant mail reader. While this approach does impose some burden on compliant mail readers, interoperability with older mail readers was deemed to be more important in this case.
    It may be the case that some user agents, if they can recognize more than one of the formats, will prefer to offer the user the choice of which format to view. This makes sense, for example, if mail includes both a nicely-formatted image version and an easily-edited text version. What is most critical, however, is that the user not automatically be shown multiple versions of the same data. Either the user should be shown the last recognized version or should explicitly be given the choice.

    JavaMail gives you access to all the parts. It's up to you to figure out
    which part you want. The spec you quoted gives some advice about
    how to find the best part for you.

  • Netscape 4.78 seems to be very picky about mime multipart/alternative?

    (This may be sort of OT for this forum, but I figured I'd give it a shot.)
    I'm experimenting with the javamail API and am having undesired results with mime multipart/alternative.
    The message I'm constructing looks like it's correct on inspection (see [1] below), but Netscape Messenger 4.78 insists on displaying the text/plain part, not the text/html part. When I create a similar message from within Messenger (see [2] below), it looks to me to be virtually the same, but Messenger properly displays the text/html part.
    Also, when I send my sample message [1] to Outlook Express, OE correctly displays the text/html part. (Haven't tried Eudora yet.)
    Is it possibly ordering of the parts? The charset? I guess I can test some more...
    My sample code is listed at [3].
    Anyone have any ideas?
    Thanks,
    dwh
    [1] Source of the message as constructed by my sample program (some information redacted for privacy):
    Return-Path: <[email protected]>
    Delivered-To: dhaskin-mydomainname:[email protected]
    X-Envelope-To: [email protected]
    Received: (qmail 98334 invoked from network); 1 Aug 2002 14:08:55 -0000
    Received: from relay1.myhostingprovider.com (HELO relay.myhostingprovider.com) (some.i.p.address)
    by yowza.myhostingprovider.com with SMTP; 1 Aug 2002 14:08:55 -0000
    Received: (qmail 72904 invoked from network); 1 Aug 2002 14:08:54 -0000
    Received: from anotheraddress.anotherprovider.com (HELO dhaskin) (another.i.p.address)
    by relay1.myhostingprovider.com with SMTP; 1 Aug 2002 14:08:54 -0000
    X-pair-Authenticated: yet.another.ip.address
    Message-ID: <4469286.1028211013779.JavaMail.dhaskin@dhaskin>
    From: [email protected]
    To: [email protected]
    Subject: Test
    Mime-Version: 1.0
    Content-Type: multipart/alternative;
    boundary="----=_Part_0_10910135.1028211013519"
    X-Mozilla-Status: 8001
    X-Mozilla-Status2: 00000000
    X-UIDL: 8a3987a249ce2fba
    ------=_Part_0_10910135.1028211013519
    Content-Type: text/html; charset=Cp1252
    Content-Transfer-Encoding: 7bit
    <html><b>This</b> is a <i>test</i></html>
    ------=_Part_0_10910135.1028211013519
    Content-Type: text/plain; charset=Cp1252
    Content-Transfer-Encoding: 7bit
    This is plain text
    ------=_Part_0_10910135.1028211013519--
    [2] Source of a similar message as constructed by Netscape Messenger:
    Return-Path: <[email protected]>
    Received: from 127.0.0.1 ([127.0.0.1])
    by dhaskin (JAMES SMTP Server 2.0a3-cvs) with SMTP ID 181
    for <dhaskin@localhost>;
    Wed, 31 Jul 2002 14:09:45 -0400
    Message-ID: <[email protected]>
    Date: Wed, 31 Jul 2002 14:09:45 -0400
    From: Denis Haskin <[email protected]>
    X-Mailer: Mozilla 4.78 [en] (Windows NT 5.0; U)
    X-Accept-Language: en
    MIME-Version: 1.0
    To: dhaskin@localhost
    Subject: test from Netscape mail
    Content-Type: multipart/alternative;
    boundary="------------6AA9B235754EC404EA78FD46"
    X-Mozilla-Status: 8001
    X-Mozilla-Status2: 00000000
    X-UIDL: Mail1028138986024-82
    --------------6AA9B235754EC404EA78FD46
    Content-Type: text/plain; charset=us-ascii
    Content-Transfer-Encoding: 7bit
    In both plain and html
    --------------6AA9B235754EC404EA78FD46
    Content-Type: text/html; charset=us-ascii
    Content-Transfer-Encoding: 7bit
    <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
    <html>
    In both plain and <b>html</b></html>
    --------------6AA9B235754EC404EA78FD46--
    [3]My sample code for sending the message: (yes, stolen straight from the javamail tutorial.)package net.stuff.mail;
    import java.util.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    public class Notifier {
       public void notify(final String s) throws Exception {
          Properties props = System.getProperties();
          props.put("mail.smtp.host", m_host);
          javax.mail.Session session = javax.mail.Session.getDefaultInstance(props);
          MimeMessage message = new MimeMessage(session);
          message.setFrom(new InternetAddress(m_from));
          message.addRecipient(Message.RecipientType.TO, new InternetAddress(m_to));
          message.setSubject("Test");
          MimeMultipart multipart = new MimeMultipart("alternative");
          MimeBodyPart part = new MimeBodyPart();
          part.setContent(s, "text/html; charset=" + System.getProperty("file.encoding"));
          multipart.addBodyPart(part);
          MimeBodyPart part2 = new MimeBodyPart();
          part2.setContent("This is plain text", "text/plain; charset=" + System.getProperty("file.encoding"));
          multipart.addBodyPart(part2);
          message.setContent(multipart);
          Transport.send(message);
       public static void main(String[] args) throws Exception {
          Notifier n = new Notifier();
          n.notify("<html><b>This</b> is a <i>test</i></html>");
       final private String m_host = "localhost";
       final private String m_from = "dhaskin@localhost";
       final private String m_to   = "dhaskin@localhost";
    }

    Thanks for the pointer.
    It turns out it's the order of the parts that seems to matter to Netscape. It seems to use the last bodypart by default. So all I did was move the text/html part last, and now Netscape does what I expect.
    I tried taking out the charset and encoding, and it still works... it's definitely the order.
    Aha. This is actually indicated by the MIME RFC. From http://www.isi.edu/in-notes/rfc2046.txt, section 5.1.4:
    In this case, the alternatives appear in an order of increasing faithfulness to the original content. In general, the best choice is the LAST part of a type supported by the recipient system's local environment.

  • 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 AM

    HTTP 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 ?

  • 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 regards

    You 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!

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • 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 Paulussen

    Hi 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.

  • Mixed content-type in email

    Hi,
    I want to send emails in html-format. However, some clents can't decode html, but includes the message as an attachment. In this case I would like to have a text that tells the reciever to open the attachment. I have tried to laborate with Content-type: multipart/mixed, but I haven't managed to get it to work. Someone having an idea about this?

    As an addition: I'm not totally sure what mail clients will do with it, but maybe you could use a structure like that:
    +----- multipart/alternative -------+
    |                                   |
    | +--- multipart/mixed -----------+ |
    | |                               | |
    | | +- text/plain --------------+ | |
    | | | save message              | | |
    | | +- text/html ---------------+ | |
    | | | contents                  | | |
    | | +---------------------------+ | |
    | |                               | |
    | +----- text/html ---------------+ |
    | | contents                      | |
    | +-------------------------------+ |
    |                                   |
    +-----------------------------------+Regards

  • Utl_mail: how to send message as 'multipart/alternative'?

    Hi,
    I´m struggling with the following problem (I´m using Oracle XE on windows):
    I want to send an email via utl_mail in both HTML- and text-version, alternatively. I´ve played with different settings in utl_mail.SEND_ATTACH_VARCHAR2.
    But when I check the sourcecode in my mail-client, each mail is generated with content-type 'multipart/mixed' (even if I specify att_inline=>FALSE). Thus, the second version is always displayed as an attachment and my mailclient does not choose the best version.
    Is there any way to do this in utl_mail or will I have to use utl_smtp?
    This is my sourcecode:
    <blockquote>
    declare
    l_from varchar2(100) := ...;
    l_to varchar2(100) := ...;
    l_cc varchar2(4000) := ...;
    l_subject varchar2(100) := 'a multipart eMail via UTL_MAIL';
    l_mimetype_1 varchar2(100) := 'text/plain; charset=utf-8';
    l_body_1 varchar2(4000) := ...;
    l_mimetype_2 varchar2(100) := 'text/html; charset=utf-8';
    l_body_2 varchar2(4000) := ... ;
    begin
    utl_mail.SEND_ATTACH_VARCHAR2(SENDER=>l_from, RECIPIENTS=>l_to, CC=>l_cc
    ,BCC=>NULL, SUBJECT=>l_subject, MESSAGE=>l_body_1
    ,MIME_TYPE=>l_mimetype_1
    ,PRIORITY=>3
         ,ATTACHMENT=>l_body_2, att_inline=>FALSE,
         att_mime_type=>l_mimetype_2);
    end;
    </blockquote>
    Thanks,
    Jens

    I guess you'll have to use UTP_SMTP.
    Maybe you'll find helpful information over here: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:255615160805

Maybe you are looking for

  • Not properly displayed report in JRC but in CR designer

    Hi, The report has two XML data sources and data are displayed in a Table. Table is designed with multiple column feature. When I run this report in CR designer preview it works fine. But When I run it in JRC, data are displayed on the report. But no

  • Application not working

    Last night I downloaded some browsers to try some new ones. Today, my printer doesn't appear to receiving info and my creative suite photoshop application won't open. My adobe acrobat (professional) also won't open. Tried disc first aid. Didn't work.

  • Win 2K8 R2 - Group Policy Management - Failed to Open Group Policy Object. You may not have appropriate rights. The network path was not found.

    New to Windows Server 2008 R2 Administration. I setup this Windows 2008 R2 Server on a Dell 2950 Poweredge server and have been migrating users off of an old NT style domain running on Samba 3.6 on CentOS. I have the domain setup (nicholas.sacredhear

  • Amount without currency

    Talking about transformation (BI7) Amount on source side (default currency, say EUR ) Amount (with currency) on target side I get error while activating Transformation with demand to assign currency field from source to target. As I mentioned before

  • White screen in Avid Meridian after export from FCP 6?

    After exporting a sequence as 10 bit uncompressed NTSC (using AJA Kona II card) on FCP Ver. 6.06, I imported the file into my Avid Symphony (Meridian). When I tried to play the file, I could only see a white screen. Audio plays fine. I have searched