Parsing MIME message

Hi,
I have a saved email message in MIME format. Some of the emails have attachments encoded using base64. I want to parse the message and extract these attachments.
I started doing this in my class by looking for pattern only to realize that these messages are based on some RFC standard. So without knowing this standard well, my class is going to work only some of the time.
Perhaps there is an existing API to parse the MIME message and get the attachments. Can anyone can tell me where I can find such API?
Thanks.

Looking at the docs, it seems that it requires a session object, but I already have the message as stream. Can it work without a session?

Similar Messages

  • Parsing mime message using MimeMessage seems to do nothing.

    I've loaded a mime message into a string, and I'm trying to parse it into a MimeMessage object, but it doesn't appear to do anything useful with it - it doesn't fail, but it just doesn't do anything!
    A segment of the code:
    System.out.println( "String size: " + msgTxt.length() );
    System.out.println( msgTxt );
    msg = new MimeMessage( session, new ByteArrayInputStream( msgTxt.getBytes() ) );
    System.out.println( "Class:" + msg.getContent().getClass().getName() );
    System.out.println( "Sender: " + msg.getSender() );
    System.out.println( "Content type: " + msg.getContentType() );
    System.out.println( "Subject: " + msg.getSubject() );
    System.out.println( "Lines: " + msg.getLineCount() );
    produces the following:
    String size: 1425
    Return-Path: <[email protected]>
    Received: from cs.ucl.ac.uk by lancaster.nexor.co.uk via JANET with NIFTP (XTPP) id
    <[email protected]>; Thu, 5 Jan 1995 17:46:35 +0000
    To: <IETF-Announce:;>
    From: [email protected]
    Subject: I-D ACTION:draft-ietf-mailext-pipeline-01.txt
    Date: Thu, 05 Jan 95 10:53:24 -0500
    Message-ID: <[email protected] I.Reston.VA.US>
    Mime-Version: 1.0
    Content-type: Multipart/Mixed; boundary="NextPart"
    --NextPart
    Content-type: text/plain; charset="us-ascii"
    A Revised Internet-Draft is available from the on-line Internet-Drafts directories.
    This draft is a work item of the Mail Extensions Working Group of the IETF.
    Title : SMTP Service Extension for Command Pipelining
    Author(s) : N. Freed, A. Cargille
    Filename : draft-ietf-mailext-pipeline-01.txt
    Pages : 9
    Date : 01/04/1995
    This memo defines an extension to the SMTP service whereby a server can indicate
    the extent of its ability to accept multiple commands in a single TCP send operation.
    Using a single TCP send operation for multiple commands can improve SMTP
    performance significantly.
    --NextPart
    Content-type: Message/External-body;
    name="draft-ietf-mailext-pipeline-01.txt";
    site="ds.internic.net"; access-type="anon-ftp"; directory="internet-drafts"
    Content-Type: text/plain
    Content-ID: <[email protected]>
    --NextPart
    Class:java.lang.String
    Sender: null
    Content type: text/plain
    Subject: null
    Lines: -1
    Am I missing the point here, or should it have parsed a mutipart body?
    Any suggestions as to what I'm doing wrongly would be greatly appreciated.
    Thanks!

    What chance did I have - my program was adding a blank line to the msgTxt string at the beginning, and then when I'd sorted that out, my sample mime message has blank lines after each separator so of course it didn't work.
    Thanks for seeing that the problem actually was the "almost invisble", which is perhaps why I'd overlooked it so many times, and why something that should have been simple, seemed to be so excruciatingly difficult!

  • Parsing MIME message and Constructing a MIME message

    Hi All,
    I want to formulate a MIME message in NetweaverXI. The MIME messsage will contain a cXML and an attachment. Then send the message to a JCA adapter.
    Similarly when the JCA adapter sends a MIME message i want to parse it and get access to each part of the MIME message.
    Is there any support available for MIME in NetweaverXI? Are there any sample examples for the same?
    The message will be in the below format.
    --Bouundary
    Content-Type: text/xml; charset=UTF-8
    Content-ID: 1255070783528.1638087094
    <cXML>
    <Attachment>
    <url> AAAAA</url>
    </Attachment>
    </cXML>
    --Bouundary
    Content-Type: text/xml; charset=UTF-8
    Content-ID: AAAAA
    Attachment
    Bouundary
    Any help will be really appreciated.
    Thanks

    Hi Ameeth,
    Please check the link below:
    /people/stefan.grube/blog/2007/04/17/xi-mail-adapter-an-approach-for-sending-emails-with-attachment-with-help-of-java-mapping
    Also, Mail can be processed using Java Mail API. Below is the code snippet send mail.
         public static boolean sendMail(String mailHost, String toAddress ,String fromAddress, String ccAddress,String subject,String mailbody,String attachmentContent,String attachmentName,MessageKey messageKey, AuditAccess audit) throws MessagingException{
              String subloc = "JavaMailSender.sendMail()";
              PIFTWrapper.entering(subloc);
              audit.addAuditLogEntry(messageKey, AuditLogStatus.SUCCESS, "Sending Mail to SMTP server");
              Properties properties = new Properties();
              properties.setProperty("mail.smtp.host", mailHost);
              Session session = Session.getInstance(properties,null);
              MimeMessage mimeMessage = new MimeMessage(session);
              mimeMessage.setFrom(new InternetAddress(fromAddress));
              mimeMessage.setRecipients(RecipientType.TO, toAddress);
              mimeMessage.setRecipients(RecipientType.CC, ccAddress);
              mimeMessage.setSubject(subject);
              mimeMessage.setSentDate(new Date());
              MimeBodyPart contentMimeBodyPart = new MimeBodyPart();
              contentMimeBodyPart.setDisposition(MimeMessage.INLINE);
              contentMimeBodyPart.setText(mailbody);
              MimeBodyPart attachmentMimeBodyPart = new MimeBodyPart();
              attachmentMimeBodyPart.setDisposition(MimeMessage.ATTACHMENT);
              attachmentMimeBodyPart.setFileName(attachmentName);
              attachmentMimeBodyPart.setText(attachmentContent);
              Multipart multipart = new MimeMultipart();
              multipart.addBodyPart(contentMimeBodyPart);
              multipart.addBodyPart(attachmentMimeBodyPart);
              mimeMessage.setContent(multipart);
              mimeMessage.saveChanges();
              Transport.send(mimeMessage);
              PIFTWrapper.exiting();
              audit.addAuditLogEntry(messageKey, AuditLogStatus.SUCCESS, "Mail Sent");
              return true;
    Similar processing can be done using Java Mail API for incomming messages.
    Regards,
    Sumant
    Edited by: SumantKRaja on Oct 20, 2009 8:07 AM

  • Getting javax.mail.internet.ParseException when parsing MIME message

    Hi All,
    The MIME Content Type is as below.
    Content-Type: application/pdf;
    name="ecm-000669.pdf";
    Content-Disposition: attachment;
    filename="ecm-000669.pdf";
    When executing the following statement
    ContentType ct = new ContentType(contentType);
    where contentType is application/pdf;
    name="ecm-000669.pdf";
    Getting the below error
    javax.mail.internet.ParseException
         at javax.mail.internet.ParameterList.<init>(ParameterList.java:61)
         at javax.mail.internet.ContentType.<init>(ContentType.java:83)
         at oracle.apps.fnd.wf.common.MIMEUtils.handleContent(MIMEUtils.java:488)
         at oracle.apps.fnd.wf.mailer.EmailParser.processSingleContent(EmailParser.java:1851)
         at oracle.apps.fnd.wf.mailer.EmailParser.parseBody(EmailParser.java:2166)
         at oracle.apps.fnd.wf.mailer.EmailParser.parseEmail(EmailParser.java:1195)
         at oracle.apps.fnd.wf.mailer.IMAPResponseHandler.processSingleMessage(IMAPResponseHandler.java:255)
         at oracle.apps.fnd.wf.mailer.IMAPResponseHandler.processMessage(IMAPResponseHandler.java:92)
         at oracle.apps.fnd.cp.gsc.SvcComponentProcessor.process(SvcComponentProcessor.java:659)
         at oracle.apps.fnd.cp.gsc.Processor.run(Processor.java:283)
         at java.lang.Thread.run(Thread.java:534)
    The error is not happening when I remove the semi colon at the end of content-type header as shown below
    Content-Type: application/pdf;
    name="ecm-000669.pdf"
    Can you please tell that semi colon at the end of Content-Type header is not supported in MIME standard? This MIME is coming from the rediff email client. Is there any parameter in Java Mail API to avoid these kind of issues?

    Yes, a trailing semicolon violates the MIME syntax spec.
    You can work around this bug in the client by setting the System property "mail.mime.parameters.strict" to "false",
    as described here: http://javamail.kenai.com/nonav/javadocs/javax/mail/internet/package-summary.html

  • Issue while parsing the chinese character from Mime Message

    Hi,
    I have a issue with the chinese characters while parsing the mime message (MimeBodypart). In the MimeMessage charset is mentioned as "gb2312". i am using the MimeBodyPart.getContent() to get the content. When mimetype is html, it will be uploaded as a file to an FTP site (wapache commons net - ftp client). When uploaded file is viewed, the content is displayed as garbage text.
    i tried the following but it didnt work. i got the inputstream from the Mimebodypart. and then created InputStreamReader and used the encoding "GB18030" while initializing the content. i got the String out of it and stored in the file. i just replaced "Gb2312" with "UTF-8" in the html string. While creating the output file, i used the UTF-8 encoding. when opened this file using IE, it is displaying the character without any issues. i examined the file and the file encoding is UTF-8 as expected.
    but when i upload the file to FTP site and view, the text is not displayed correctly. It seems the file encodig is ANSI. i used the Notepad++ to examine these files. Please note that we use apache comments net - FTp client to upload the file.
    below are my questions:
    am i doing the right thing? it seems mime message was created using outlook.
    How to upload a file to FTp withe file base encoding is "UTF-8" or some other ?
    below are few references
    http://www.anyang-window.com.cn/tag/java-gb2312/
    JavaMail: Chinese Simplified Character Problem

    Thank you for the Replies. i am using the binary mode and it works fine for most of the files. i found that the issue here is not while uploading but the content itself. the characters present in the Mimemessge is not as per the charset. Hence i could not upload the content as it is. This happens only when charset is GB2312 (chinese). it seems that Mimemessage contains the characters which cannot be represented by Gb2312 but can be represented by Gb18030. Hence i converted the content using from Gb18030 to UTF-8 and created a file. i used the SetControlEncoding("utf-8") to upload the file and it is working fine.

  • How to create an S/MIME message in Windows Phone 8?

    Hi!
    I am communicating with a backend that requires me to create on the Phone a message that follows the S/MIME standard. I have stored a public key in the IsolatedStorage on the phone, but I am not sure how to build the S/MIME message since there doesn't seem
    to exist any support for this in Phone 8 .NET framework.
    Does anyone have suggestions on how to accomplish this? There seems to be very little X509 support in Phone 8. I have talked to a fellow developer that did the Android app, and they used Bouncy Castle SMIME libraries (javamail) but these have not been ported
    to the C# version of Bouncy Castle.
    Any ideas? I have never built an S/MIME message before, but as far as I can tell it is a simple header-body design where the body can have a nested structure, and the body can also be encrypted.
    I ahve checked the
    http://social.msdn.microsoft.com/Forums/en-US/netfxnetcom/thread/74e4711e-1f66-43a7-9e3b-bc9cfbcd1b73/ post, and they use cms classes that doesn't exist in Phone 8... :(
    best regards
    /S
    Henrik

    If you want S/MIME support on Windows Phone, take a look at MimeKit (https://github.com/jstedfast/MimeKit) and MailKit (https://github.com/jstedfast/MailKit).
    MimeKit is a very fast and robust MIME parser implementation written in C# that uses BouncyCastle for the low-level cryptography and supports both S/MIME v3.2 and PGP.
    MailKit builds on top of MimeKit to add SMTP, POP3, and IMAP support.
    Both projects are completely open source and free for commercial use.

  • Constructing MIME message in BPEL

    Hi,
    I want to construct a MIME message in BPEL. This MIME message will have a cXML and an attachment. How can i do this? Are there any standard schemas provided to define MIME in BPEL
    Similarly when i get a MIME message from a service i want to access this message and access each part of the MIME message.
    i know we cannot parse a mime message in BPEL but i want know how can i access each part of the mime in BPEL.
    Is this possible to do in BPEL?
    I am using SOA 10.1.3.4.0
    Any help is really appreciated in this.
    Thanks,
    Amith
    Edited by: [email protected] on Oct 16, 2009 3:15 AM
    Edited by: [email protected] on Oct 16, 2009 3:18 AM

    Please find more details here.
    I am using the schema defined in "http://schemas.xmlsoap.org/wsdl/mime/2002-01-29.xsd". I have modified the schema so that it does not throw error in JDeveloper.The modified schema is
    <xsd:schema targetNamespace="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:ns1="http://schemas.xmlsoap.org/wsdl"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/"/>
    <xsd:element name="content" type="mime:contentType"/>
    <xsd:complexType name="contentType">
    <xsd:complexContent>
    <xsd:extension base="ns1:tExtensibilityElement">
    <xsd:sequence/>
    <xsd:attribute name="type" type="xsd:string" use="optional"/>
    <xsd:attribute name="part" type="xsd:NMTOKEN" use="optional"/>
    </xsd:extension>
    </xsd:complexContent>
    </xsd:complexType>
    <xsd:element name="multipartRelated" type="mime:multipartRelatedType"/>
    <xsd:complexType name="multipartRelatedType">
    <xsd:complexContent>
    <xsd:extension base="ns1:tExtensibilityElement">
    <xsd:sequence>
    <xsd:element name="part" type="mime:tPart" minOccurs="0"
    maxOccurs="unbounded" default="qualified"/>
    </xsd:sequence>
    </xsd:extension>
    </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="tPart">
    <xsd:sequence>
    <xsd:any namespace="##targetNamespace" minOccurs="0"
    maxOccurs="unbounded"/>
    </xsd:sequence>
    <xsd:attribute name="name" type="xsd:NMTOKEN" use="required"/>
    </xsd:complexType>
    <xsd:element name="mimeXml" type="mime:tMimeXml"/>
    <xsd:complexType name="tMimeXml">
    <xsd:complexContent>
    <xsd:extension base="ns1:tExtensibilityElement">
    <xsd:sequence/>
    <xsd:attribute name="part" type="xsd:NMTOKEN" use="optional"/>
    </xsd:extension>
    </xsd:complexContent>
    </xsd:complexType>
    </xsd:schema>
    When i try to create a variable of the above schema type, i get an exception "Exception: Invalid reference: http://schemas.xmlsoap.org/wsdl/:tExtensibilityElement'".
    Is there anything wrong with the schema?

  • Parse SPML message in BPEL ?

    Hello ,
    Do you guys know how to parse SPML message in BPEL process ? As we get the SPML message in process input of BPEL process.

    Please find more details here.
    I am using the schema defined in "http://schemas.xmlsoap.org/wsdl/mime/2002-01-29.xsd". I have modified the schema so that it does not throw error in JDeveloper.The modified schema is
    <xsd:schema targetNamespace="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:ns1="http://schemas.xmlsoap.org/wsdl"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/"/>
    <xsd:element name="content" type="mime:contentType"/>
    <xsd:complexType name="contentType">
    <xsd:complexContent>
    <xsd:extension base="ns1:tExtensibilityElement">
    <xsd:sequence/>
    <xsd:attribute name="type" type="xsd:string" use="optional"/>
    <xsd:attribute name="part" type="xsd:NMTOKEN" use="optional"/>
    </xsd:extension>
    </xsd:complexContent>
    </xsd:complexType>
    <xsd:element name="multipartRelated" type="mime:multipartRelatedType"/>
    <xsd:complexType name="multipartRelatedType">
    <xsd:complexContent>
    <xsd:extension base="ns1:tExtensibilityElement">
    <xsd:sequence>
    <xsd:element name="part" type="mime:tPart" minOccurs="0"
    maxOccurs="unbounded" default="qualified"/>
    </xsd:sequence>
    </xsd:extension>
    </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="tPart">
    <xsd:sequence>
    <xsd:any namespace="##targetNamespace" minOccurs="0"
    maxOccurs="unbounded"/>
    </xsd:sequence>
    <xsd:attribute name="name" type="xsd:NMTOKEN" use="required"/>
    </xsd:complexType>
    <xsd:element name="mimeXml" type="mime:tMimeXml"/>
    <xsd:complexType name="tMimeXml">
    <xsd:complexContent>
    <xsd:extension base="ns1:tExtensibilityElement">
    <xsd:sequence/>
    <xsd:attribute name="part" type="xsd:NMTOKEN" use="optional"/>
    </xsd:extension>
    </xsd:complexContent>
    </xsd:complexType>
    </xsd:schema>
    When i try to create a variable of the above schema type, i get an exception "Exception: Invalid reference: http://schemas.xmlsoap.org/wsdl/:tExtensibilityElement'".
    Is there anything wrong with the schema?

  • How to get the entire MIME message from a  BodyPart?

    Hi there,
    I am new to javaMail and quite lost with its way of working.
    I have a tool that creates SMIME stuff that needs to be put into MIME envelopes. In the same time I have to manage parsing of simple MIME messages.
    My current problem is the following:
    I have a BodyPart and I am testing if it is SMIME or not (with checks on the ContentType). If it is, then I want to retrieve the entire MIME message (I mean, the the whole text stuff with the headers and the -possibly- encoded64 content) as a String or a byte[]. But I haven't found anything in BodyPart that returns such a thing (everything is about the content). There might be writeTo() but it gives need an output stream that if piped in a pipedinputstream results in a dead lock...
    Help please!!
    Lionel

    hai
    i think you can use the methods in the MimeMessage to get the headers of the message
    by using any one the following
    1) getAllHeaders() use the enumeartion concept and then get the values for the headers using the getHeader(enum.getNextElements())
    2) or use the specific methods such as
    getFrom()
    getAllRecepients()
    getContentType()
    3) getHeader(string headername)
    bye

  • Parser Error Message: Could not load file or assembly 'Oracle.DataAccess, V

    I'm working on a 64 bit windows 7 ultimate system and I can't get the Oracle.DataAccess and Oracle.Web to load on the helloworld web page
    See error below. At the very end i have the gacutil output. Also, the same dll's work on a 32 bit windows 7 system. I've also tried to load the beta version of the odac 64 bit
    but it it gets a "java stopped working error"
    Thanks in advance
    WEB PAGE ERRORVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
    Server Error in '/test/helloworld' Application.
    Configuration Error
    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
    Parser Error Message: Could not load file or assembly 'Oracle.DataAccess, Version=2.112.1.1, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.
    Source Error:
    Line 37:                     <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    Line 38:                     <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    Line 39:                     <add assembly="Oracle.DataAccess, Version=2.112.1.1, Culture=neutral, PublicKeyToken=89B483F429C47342"/>
    Line 40:                     <add assembly="Oracle.Web, Version=2.112.1.1, Culture=neutral, PublicKeyToken=89B483F429C47342"/></assemblies>
    Line 41:           </compilation>
    Source File: C:\inetpub\wwwroot\test\helloworld\web.config Line: 39
    Assembly Load Trace: The following information can be helpful to determine why the assembly 'Oracle.DataAccess, Version=2.112.1.1, Culture=neutral, PublicKeyToken=89b483f429c47342' could not be loaded.
    === Pre-bind state information ===
    LOG: User = IIS APPPOOL\DefaultAppPool
    LOG: DisplayName = Oracle.DataAccess, Version=2.112.1.1, Culture=neutral, PublicKeyToken=89b483f429c47342
    (Fully-specified)
    LOG: Appbase = file:///C:/inetpub/wwwroot/test/helloworld/
    LOG: Initial PrivatePath = C:\inetpub\wwwroot\test\helloworld\bin
    Calling assembly : (Unknown).
    ===
    LOG: This bind starts in default load context.
    LOG: Using application configuration file: C:\inetpub\wwwroot\test\helloworld\web.config
    LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Aspnet.config
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
    LOG: Post-policy reference: Oracle.DataAccess, Version=2.112.1.1, Culture=neutral, PublicKeyToken=89b483f429c47342
    LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/Temporary ASP.NET Files/test_helloworld/480589f5/895d06ab/Oracle.DataAccess.DLL.
    LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/Temporary ASP.NET Files/test_helloworld/480589f5/895d06ab/Oracle.DataAccess/Oracle.DataAccess.DLL.
    LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/test/helloworld/bin/Oracle.DataAccess.DLL.
    LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/test/helloworld/bin/Oracle.DataAccess/Oracle.DataAccess.DLL.
    LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/Temporary ASP.NET Files/test_helloworld/480589f5/895d06ab/Oracle.DataAccess.EXE.
    LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/Temporary ASP.NET Files/test_helloworld/480589f5/895d06ab/Oracle.DataAccess/Oracle.DataAccess.EXE.
    LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/test/helloworld/bin/Oracle.DataAccess.EXE.
    LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/test/helloworld/bin/Oracle.DataAccess/Oracle.DataAccess.EXE.
    Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927
    gacuil output
    VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
    C:\Users\Administrator>C:\"Program Files"\"Microsoft SDKs"\Windows\v6.0A\Bin\x64
    \gacutil.exe /l Oracle.DataAccess
    Microsoft (R) .NET Global Assembly Cache Utility. Version 3.5.21022.8
    Copyright (c) Microsoft Corporation. All rights reserved.
    The Global Assembly Cache contains the following assemblies:
    Oracle.DataAccess, Version=2.112.1.1, Culture=neutral, PublicKeyToken=89b483f4
    29c47342, processorArchitecture=x86
    Edited by: burk_s on Jun 6, 2010 2:42 PM

    Hi Mubarak,
    Please firstly make sure you installed SharePoint Foundation 2010 with SP2 in a Windows Server 2012 R2. Since only SP2 slipstream installations are supported on Windows Server 2012 R2
    http://blogs.technet.com/b/stefan_gossner/archive/2014/05/03/sharepoint-2010-sp2-and-windows-server-2012-r2.aspx
    http://blogs.technet.com/b/stefan_gossner/archive/2013/09/19/slipstream-version-of-sharepoint-foundation-2010-with-sp2-included.aspx
    Regards,
    Rebecca Tu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • AS2 Adapter Error: Error while parsing AS2 message: AUTHENTICATION_ERROR #

    Hi,
    Following Scenario: Inbound.
    i have been receiving messages via Seeburger AS2 Adapter with the following Error message
    Error while parsing AS2 message: AUTHENTICATION_ERROR # 
    I have done the following in the AS2 adapter as per findings in the forum
    1. Unchecked the Authentication Required Flag.
    2. AS2 Certificates are fine.
    3. Use Authentication: Disabled (there is no authentication)
    even though every thing seems to be fine i am not able to receive messages successfully. Please let me know what could have gone wrong here.

    Hi Venkatesh,
    >> Everything is provided in the Sender Agreement. Partners Certificate, Self Encryption & Signing certificate
    How come you are using encryption when you are receiving the message. I think it might be decryption.
    1. Anyway please cross check whether you provide the following correct details in Sender agreement.
    Sender Configuration
    Authentication Certificate : Partner's public certificate.
    AS2 Receiver Configuration
    Decryption Key     :         Own private key.
    Signing Key          :         Own private key.
    2. Can you please check and tell in the Seeburger Monitoring for the incoming message, whether they are sending the message with encryption and signing? This you can check in the Seeburger Monitoring.

  • B2B Message Error - Decrypting S/MIME message failed

    Hi,
    Am getting following error when i receive the inbound message from trading partner
    I have set up the certificates on both sides.
    [2010-04-15T19:53:18.981-04:00] [soa_server1] [ERROR] [] [oracle.soa.b2b.engine] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@a8acf9] [userId: <anonymous>] [ecid: 0000IW2gpmo7MAYVLqBT8A1BlpVK00000E,0] [APP: soa-infra] [composite_name: StockXferRecSOA] [component_name: StockBPEL/StockXferReciptService] [component_instance_id: 310009] Error -: B2B-51093: Decrypting S/MIME message failed {0}.[[
    Error -: B2B-51093: Decrypting S/MIME message failed {0}.
         at oracle.tip.b2b.packaging.SmimeSecureMessaging.decrypt(SmimeSecureMessaging.java:1024)
         at oracle.tip.b2b.packaging.mime.MimePackaging.processEncryptedMimeBodyPart(MimePackaging.java:1107)
         at oracle.tip.b2b.packaging.mime.MimePackaging.processInputStreamOrStringMessage(MimePackaging.java:1173)
         at oracle.tip.b2b.packaging.mime.MimePackaging.processMessageContent(MimePackaging.java:793)
         at oracle.tip.b2b.packaging.mime.MimePackaging.doUnpack(MimePackaging.java:726)
         at oracle.tip.b2b.packaging.mime.MimePackaging.unpack(MimePackaging.java:632)
         at oracle.tip.b2b.engine.Engine.processIncomingMessageImpl(Engine.java:1583)
         at oracle.tip.b2b.engine.Engine.processIncomingMessage(Engine.java:1395)
         at oracle.tip.b2b.engine.Engine.incomingContinueProcess(Engine.java:3216)
         at oracle.tip.b2b.engine.Engine.handleMessageEvent(Engine.java:2960)
         at oracle.tip.b2b.engine.Engine.processEvents(Engine.java:2706)
         at oracle.tip.b2b.engine.ThreadWorkExecutor.processEvent(ThreadWorkExecutor.java:540)
         at oracle.tip.b2b.engine.ThreadWorkExecutor.run(ThreadWorkExecutor.java:200)
         at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:77)
         at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:183)
         at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
    [2010-04-15T19:53:18.981-04:00] [soa_server1] [ERROR] [] [oracle.soa.b2b.engine] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@a8acf9] [userId: <anonymous>] [ecid: 0000IW2gpmo7MAYVLqBT8A1BlpVK00000E,0] [APP: soa-infra] [composite_name: StockXferRecSOA] [component_name: StockBPEL/StockXferReciptService] [component_instance_id: 310009] Error -: B2B-51093: Decrypting S/MIME message failed {0}.[[
         at oracle.tip.b2b.packaging.SmimeSecureMessaging.decrypt(SmimeSecureMessaging.java:1024)
         at oracle.tip.b2b.packaging.mime.MimePackaging.processEncryptedMimeBodyPart(MimePackaging.java:1107)
         at oracle.tip.b2b.packaging.mime.MimePackaging.processInputStreamOrStringMessage(MimePackaging.java:1173)
         at oracle.tip.b2b.packaging.mime.MimePackaging.processMessageContent(MimePackaging.java:793)
         at oracle.tip.b2b.packaging.mime.MimePackaging.doUnpack(MimePackaging.java:726)
         at oracle.tip.b2b.packaging.mime.MimePackaging.unpack(MimePackaging.java:632)
         at oracle.tip.b2b.engine.Engine.processIncomingMessageImpl(Engine.java:1583)
         at oracle.tip.b2b.engine.Engine.processIncomingMessage(Engine.java:1395)
         at oracle.tip.b2b.engine.Engine.incomingContinueProcess(Engine.java:3216)
         at oracle.tip.b2b.engine.Engine.handleMessageEvent(Engine.java:2960)
         at oracle.tip.b2b.engine.Engine.processEvents(Engine.java:2706)
         at oracle.tip.b2b.engine.ThreadWorkExecutor.processEvent(ThreadWorkExecutor.java:540)
         at oracle.tip.b2b.engine.ThreadWorkExecutor.run(ThreadWorkExecutor.java:200)
         at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:77)
         at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:183)
         at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
    [2010-04-15T19:53:18.981-04:00] [soa_server1] [TRACE:32] [] [oracle.soa.b2b.engine] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@a8acf9] [userId: <anonymous>] [ecid:
    Thanks,
    Arun Jadhav                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi Arun,
    Problem is that B2B is not able to decrypt the incoming message. There could be two possible reasons behind this -
    1. Your TP is not encrypting the message from your client certificate's public key (you should provide your client cert's public key to your TP and ask them to use that for encrypting the messages)
    2. You have not set up the corresponding private key at your B2B (in Host TP configuration and in deliver channel configuration of host TP)
    Please paste the complete log here/mail it to my id.
    Remote trading partner should encrypt the message using your your client cert's public key and you should decrypt it using your private key.
    For this ask your trading partner to encrypt the message using your provided public cert and at your side select the same cert in the delivery channel of your host DC under encryption credential. Make sure that keystore is containing this cert's private key.
    Regards,
    Anuj

  • Javax.mail.internet.ParseException when trying to send a MIME message

    Hi,
    I am using JavaMail to send a MIME message, but I am getting the following exception:
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at javax.mail.MessagingException.<init>(MessagingException.java:34)
    at javax.mail.internet.ParseException.<init>(ParseException.java:27)
    at javax.mail.internet.ParameterList.<init>(Compiled Code)
    at javax.mail.internet.ContentType.<init>(ContentType.java:82)
    at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1051)
    at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:1923)
    at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:1904)
    at javax.mail.Transport.send(Transport.java:101)
    at FPSend.main(Compiled Code)
    The problem seems to be the header of the message, specifically the class-id filed of the content-type. This is the content-type header that causes javaMail to throw that exception:
    Content-Type: multipart/alternative;
    boundary="------------110059296832670";
    class-id=11:9sc9bnYwM87box:2680047
    I think the ":" character in the class-id is causing the problem. Does anybody know if those characters are valid according to MIME standards? And if they are not valid, is there a work around this problem?
    thank you!

    RFC 2046 doesn't mention the existence of the class-id parameter. But it does say this:Thus, a typical "multipart" Content-Type header field might look like this:
         Content-Type: multipart/mixed; boundary=gc0p4Jq0M2Yt08j34c0p
    But the following is not valid:
         Content-Type: multipart/mixed; boundary=gc0pJq0M:08jU534c0p
    (because of the colon) and must instead be represented as
         Content-Type: multipart/mixed; boundary="gc0pJq0M:08jU534c0p"From what I see elsewhere, Class-ID is a Microsoft extension. It wouldn't be surprising to find that Microsoft uses extensions that are incompatible with the MIME standards.

  • Convergence not displaying all of Mulitpart MIME messages

    Occasionally a message will come through, readable in IMAP, and even in Comms Express 6.3, but it's blank in Convergence 1u2.
    Invariably said message will always start with:
    "This is a multi-part message in MIME format."
    And in Convergence the rest of it is blank. Here's an example. The part that says "For those planning to go, Chotchky's at 5:30pm." is not visible in Convergence, but is visible over IMAP and in CE 6.3:
    Return-path: <[email protected]>
    Received: from mta4.school.edu ([10.1.106.74])
    by ms0.school.edu (Sun Java(tm) System Messaging Server 6.3-6.03 (built Mar
    14 2008; 32bit)) with ESMTP id <[email protected]> for
    [email protected]; Thu, 20 Aug 2009 16:37:13 -0400 (EDT)
    Original-recipient: rfc822;[email protected]
    Received: from lyris.school.edu ([130.68.1.204])
    by mta4.school.edu (Sun Java(tm) System Messaging Server 6.3-8.01 (built
    Dec 16 2008; 32bit)) with SMTP id <[email protected]> for
    [email protected] (ORCPT [email protected]); Thu,
    20 Aug 2009 16:37:13 -0400 (EDT)
    Message-id:
    <LISTMANAGER-439878-20171-2009.08.20-16.37.06--me#[email protected]>
    Date: Thu, 20 Aug 2009 16:33:11 -0400
    From: Veep Headguy <[email protected]>
    Reply-to: Veep Headguy <[email protected]>
    Organization: School
    User-Agent: Thunderbird 2.0.0.22 (Windows/20090605)
    MIME-version: 1.0
    To: Information Technology <[email protected]>
    Subject: [msu-it-all] End of summer gathering
    Content-type: multipart/mixed; boundary=------------040003060804070804070803
    List-Unsubscribe: <mailto:[email protected]>
    --------------040003060804070804070803
    Content-Type: text/plain; charset="us-ascii"
    Content-description: header
    --------- Information Technology mailing list --------
    This is a multi-part message in MIME format.
    --------------040003060804070804070803
    Content-Type: text/plain; charset=ISO-8859-1; format=flowed
    Content-Transfer-Encoding: 7bit
    For those planning to go, Chotchky's at 5:30pm.
    --------------040003060804070804070803
    Content-Type: text/x-vcard; charset=utf-8;
    name="vcard.vcf"
    Content-Transfer-Encoding: 7bit
    Content-Disposition: attachment;
    filename="vcard.vcf"
    begin:vcard
    ...snip...
    end:vcard
    --------------040003060804070804070803
    Content-Type: text/plain; charset="us-ascii"
    Content-description: footer
    Veep Headguy, CIO of School
    --------------040003060804070804070803--

    Shane,
    After a long delay I'm looking at this issue again and your initial argument for the bug doesn't seem to hold true. We've switched mailing list providers since, which has resolved the "space on blank line" issue and the incorrect placement of the "multi-part MIME" message (at least for messages sent in plain text). Convergence (1u3 now) takes the header MIME portion, duplicates it, and does not display the message content.
    As the message source appears:
    Content-type: multipart/mixed; boundary="----------=_1277239432-28582-15"
    This is a multi-part message in MIME format...
    ------------=_1277239432-28582-15
    Content-Type: text/plain; charset="UTF-8"; name="message-header.txt"
    Content-Disposition: inline; filename="message-header.txt"
    Content-Transfer-Encoding: 8bit
    MIME-Version: 1.0
    X-Mailer: MIME-tools 5.427 (Entity 5.427)
    ANYTHING YOU SAY CAN AND WILL BE USED AGAINST YOU IN A COURT OF LAWYERS
    ------------=_1277239432-28582-15
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 7bit
    Still delicious, though.
    Adam N. Copeland
    Office of Information Technology
    Systems and Security Group
    www.montclair.edu/~copelanda
    ------------=_1277239432-28582-15
    Content-Type: text/plain; charset="UTF-8"; name="message-footer.txt"
    Content-Disposition: inline; filename="message-footer.txt"
    Content-Transfer-Encoding: 8bit
    test-copelanda
    Your favorite chewing gum is coming back into style! Football.
    ------------=_1277239432-28582-15--How the message appears in Convergence:
    ANYTHING YOU SAY CAN AND WILL BE USED AGAINST YOU IN A COURT OF LAWYERS **************************************************************************************************************
    ANYTHING YOU SAY CAN AND WILL BE USED AGAINST YOU IN A COURT OF LAWYERS **************************************************************************************************************
    test-copelanda Your favorite chewing gum is coming back into style! Football.

  • How to send digitally sign S/MIME messages with Powershell cmdlet Send-MailMessage?

    Hello,
    using AD Windows PKI I assigned a certificate EKU (1.3.6.1.5.5.7.3.4) to sign emails and get this with
    autoenrollment also to my CERT Store PS
    CERT:\CurrentUser\UserDS\ or the certificate could found via MMC / certificates in the store structur under "Active Directory User Object".
    Signed messages (red icon) to send as S/MIME message using Outlook 2010 is not a problem.
    Using PowerShell cmdlet Send-MailMessage to be sent company notification for a new passwordpolicy some days before pwd expired?! I use the cmdlet already successfully to filling HTML bodies with variables and send to individuals accounts.
    Reduced simplified PS code:
    $SMTPBodyHtmlTemplate = Get-Content "C:\PS\Template\HTMLBody.html" | Out-String
    Function SendEmailNotification # /* SEND E-MAIL Notification to User */#
    [string] $SMTPServer = "mail.domain.local"
    $CurrentUser = "$env:username"
    [string]$SMTPFrom = (Get-ADUser $CurrentUser -properties mail).mail
    [string[]] $SMTPTo = $($Obj.EmailAddress)
    [string]$SMTPSubject = "Notification!"
    [String]$SMTPBodyHtml = $SMTPBodyHtmlTemplate.Replace("UserDisplayname","$($UserDisplayname)")
    Send-MailMessage -From $SMTPFrom -To $SMTPTo -Subject $SMTPSubject -BodyAsHtml $SMTPBodyHtml -dno OnFailure -SmtpServer $SMTPServer -encoding ([System.Text.Encoding]::UTF8) -ErrorAction Continue
    How can I use the PSDrive own CERT and using PowerShell cmdlet Send-MailMessage
    to send a signed message, without development experience?
    Thanks in advance for cooperation.
    Manfred Schüler

    Hi,
    could create with an other colleague a DLL file (with this informations) for successfully sending sign messages from PS-Script. 
    Function SendEmailNotification # /* SEND SIGN E-MAIL */#
    $SMTPBodyHtmlTemplate = Get-Content "C:\PS\Template\HTML.html" | Out-String
    [System.Reflection.Assembly]::LoadFile("C:\PS\Assembly\Cpi.Net.SecureMail.dll") | Out-Null
    [string]$strSmtpServer = "smtp.domain.local"
    [string]$strSmtpPort = "25"
    [string]$strFrom = (Get-ADUser $CurrentUser -properties mail).mail
    [string]$strFromAlias = (Get-ADUser $CurrentUser -properties DisplayName).DisplayName
    [string]$strTo = $UserEmailAddress
    [string]$strToAlias = $UserEmailDisplayName
    [String]$strSubject = "Subject as you like"
    [string]$strBody = $SMTPBodyHtmlTemplate.Replace("UserDisplayname","$($UserDisplayname)")
    $objMail = New-Object Cpi.Net.SecureMail.SecureMailMessage
    $objFrom = New-Object Cpi.Net.SecureMail.SecureMailAddress($strFrom,$strFromAlias,$objCert,$objCert)
    $objTo = New-Object Cpi.Net.SecureMail.SecureMailAddress($strTo,$strToAlias)
    $objMail.From = $objFrom
    $objMail.to.Add($objTo)
    $objMail.Subject = $strSubject
    $objMail.Body = $strBody
    $objMail.IsBodyHtml = $TRUE
    $objMail.IsSigned = $TRUE
    $objMail.IsEncrypted = $FALSE
    $objSMTPClient = New-Object System.Net.Mail.SmtpClient($strSmtpServer,$strSmtpPort)
    $objSMTPClient.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
    $objSMTPClient.send($objMail)
    Maybe Microsoft can implement this in future versions of the cmdlets Send-MailMessage ;-)
    Manfred Schüler

Maybe you are looking for

  • Is it possible to pass table name as parameter to function calls?

    Let's say I would like to retrieve data from table BSAD, BSID, BSIS, BSAS with the exact same WHERE conditions. I.E.       SELECT SINGLE * FROM bsis            WHERE bukrs = zbukrs              AND belnr = zbelnr              AND gjahr = zgjahr      

  • My new Ipod Touch has frozen in Safari :{

    i was at work using their WiFi, listening to a lecture from the website Unwelcome Guests, when i lost the signal.....i went home and clicked onto the Safari Icon, and the same website's page was on my screen, but is completely frozen

  • Template, recordset and querystrings

    hello, i've got a problem that's vexing me. I am using ASP/VBScript with DW CS3. I am trying to get a repeating region to populate. I have a template and a child page of the template. On the template page I created bindings that are associated with t

  • Updates Download failure U43M1D204

    Unable to get current updates for Photoshop, Bridge and After Effects (Camera Raw?) due to "Update Failed" message with error code. Was able to re-install Photoshop, but got a message that "Patch Failed" and it is apparently related to the update pro

  • Error at Master Data

    Dear  Gurus, Please throw some lights on: Update Server Found for Context: E: Got this error/msg while saving the 2 nd Customer Master at [XD01]. It doesn't allow to save material master at [MM01] also. When click at the error/msg to view  the detail