Sender Mail adapter: Null Pointer Exception

Hi ,
Sender mail communication channel using mail package  & POP3 protocol is showing the Error: exception caught during processing mail message; java.lang.NullPointerException.  Initially it works fine but now it is showing this error. I could not get the root cause of this error.
Can any one help me to resolve the issue?
Thanks in Advance
Krishna

Hi Sherin Jose,
There is no value mapping used here.
I am not getting the root cause for this error. can any one suugest
Thanks & regards,
Krishna

Similar Messages

  • While trying to send mail getting NUll Pointer exception

    Hi,
    I am trying to send email through email notification but instance doesn't through any fault but on opmn log it sends null pointer exception and doesn't send any mail. But some other flow using same SMTP server are able to send mail.
    Exceptions:
    07/11/14 16:46:25 java.lang.NullPointerException
    07/11/14 16:46:25      at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:363)
    07/11/14 16:46:25      at oracle.tip.pc.services.notification.email.EmailDriver.sendMessage(EmailDriver.java:207)
    07/11/14 16:46:25      at oracle.tip.pc.services.notification.email.EmailDriver.send(EmailDriver.java:185)
    07/11/14 16:46:25      at oracle.tip.pc.services.notification.DefaultNotificationServiceImpl.sendEmailNotification(DefaultNotificationServiceImpl.java:251)
    07/11/14 16:46:25      at oracle.tip.pc.services.notification.NotificationServiceImpl.sendEmailNotification(NotificationServiceImpl.java:271)
    07/11/14 16:46:25      at oracle.bpel.services.notification.queue.sender.MDBConsumer.deliverNotification(MDBConsumer.java:256)
    07/11/14 16:46:25      at oracle.bpel.services.notification.queue.sender.MDBConsumer.onMessage(MDBConsumer.java:137)
    07/11/14 16:46:25      at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
    07/11/14 16:46:25      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    07/11/14 16:46:25      at java.lang.reflect.Method.invoke(Method.java:585)
    07/11/14 16:46:25      at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
    07/11/14 16:46:25      at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    07/11/14 16:46:25      at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
    07/11/14 16:46:25      at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    07/11/14 16:46:25      at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
    07/11/14 16:46:25      at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    07/11/14 16:46:25      at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
    07/11/14 16:46:25      at com.evermind.server.ejb.MessageDrivenConsumer.onMessage(MessageDrivenConsumer.java:347)
    07/11/14 16:46:25      at com.evermind.server.ejb.MessageDrivenConsumer.processMessages(MessageDrivenConsumer.java:233)
    07/11/14 16:46:25      at com.evermind.server.ejb.MessageDrivenConsumer.run(MessageDrivenConsumer.java:169)
    07/11/14 16:46:25      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
    07/11/14 16:46:25      at java.lang.Thread.run(Thread.java:595)
    Any Idea?

    Hi,
    I am also trying E-mail Activity but I am not able to receive the e-mail.
    I have set the following in the ns_emails.xml
    <EmailAccount>
    <Name>Default</Name>
    <GeneralSettings>
    <FromName>Oracle BPM</FromName>
    <FromAddress>[email protected]</FromAddress>
    </GeneralSettings>
    <OutgoingServerSettings>
    <SMTPHost>Server' IPADRESS</SMTPHost>
    <SMTPPort>25</SMTPPort>
    </OutgoingServerSettings>
    <IncomingServerSettings>
    <SMTPHost>Server' IPADRESS</SMTPHost>
    <SMTPPort>25</SMTPPort>
    </IncomingServerSettings>
    In this "[email protected]" is the user configured and "Server' IPADRESS" is the IPADDRESS of the SMTP server.
    Moreover I have also have SMTP server as the incoming server.
    Now I have a simple BPEL PROCESS having Email Activity of sending a mail.
    The "To" section has "[email protected]".
    I am not able to recive the mail and I have also cheked the SMTP server there is no mail there but BPEL Process runs fine.
    I also have one Script which can send mail to the user Ihave mentioned and it works fine.So server setting seems to be fine.Are there any other setting required.
    If you are able to send the mail then can you give me your inputs on this issue.
    Regards
    Lalit

  • Sender Mail Adapter Error: exception caught during processing mail message;

    HI , I am configuring mail to file scenario. Need to read mail content (no need to capture From,TO or Subject details) and create a file with the content in the mail.
    Need to read mails from microsoft outlook. Exchange server has been configured for POP3 protocol.
    Following are the details provoding in sender mail adapter:
    URL: provided url in the format: pop://<server name>
    Authentication method: plain
    provided user credinetions to access mails.
    poll interval - 1min
    content encoding none.
    processing parameters : quality of service-exactly once
    Since there is no need to capture From,TO or Subject details, didn't select the option - use mail package.
    Verified for unread mails in the mail box and made sure that there are few unread mails.
    Also, created data types and other components in IR and completed mapping.
    But after starting sender mail communication channel, getting error "exception caught during processing mail message; java.lang.NullPointerException" in RWB-adapter-communication channel monitoring.
    please let me know what needs to be done to resolve this error.
    Thanks.

    HI Stefan, i tried, but still it is giving same error. Yes, i am able to access outlook mail with the user credentials given in the communication channel to access exchange server.
    I am using message protocol: xipayload . Also since i dont have to capture TO,from,subject details., created data type just with one element of type string, not in the standard format .Does this makes any difference.

  • Exception in XI sender mail adapter

    Hi,
    XI sender mail adapter raised the following exception when it was fetching emails from a mailbox on a MS mail server while these mails were sent from a unix system.
    Adapter-Error: exception caught during processing mail message [1]com.sap.aii.messaging.lang.com.sap.aii.messaging.lang.BinaryIndexOutOfBoundsException: Binary index out of range: -3
    However if I sent the same attachment to the same mailbox from yahoo the XI sender mail adapter can process it correctly.
    I would appreciate if somebody could share his/her expertise or experience regarding this issue.
    Many thanks.
    Zhongliang

    I dont think this has got something to do with Unix or Windows system. As per the exceptions is considered, it says that, index out of range, which can occure in cases, by the time it was about to process the next mail, it could have been deleted or moved to some other folder..
    VJ

  • Sender  Mail Adapter - java.lang.NullPointerException in CC monitoring

    hi,
    I configured my Sender Mail Adapter correctly.
    I have the correct POP URL, authentication. I'm not using PayloadSwapBean right now.
    I can't get rid of the exception inside my Channel monitoring.
    exception caught during processing mail message; java.lang.NullPointerException
    does anyone know why?
    I've been told the POP account has emails already.
    I will try to create an outlook account for this POP e-mail account in the mean time to see the e-mails.
    Thank you

    thanks aaron.
    I don't see the folder ./SYS/../j2ee/...
    will it be under another folder?  I don't see a trace log folder either.
    I think the problem might be in the Module tab.
    I tried.
    AF_Modules/PayloadSwapBean
    localejbs/AF_Modules/PayloadSwapBean
    /localejbs/AF_Modules/PayloadSwapBean
    sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
    localejbs/sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
    /localejbs/sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
    they all produce the same error. I wonder if these Beans actually exist.
    I think we might have to reinstall this Mail Adapter altogether.
    Or maybe it's really the connection to the Mail Server. But would it display this kind of message.
    This is what I'm looking at.
    Also, i had to use this URL
    pop://server:995/
    (995 is using SSL and it is the default port).  When I use this, I see the Java Null Pointer Exception a lot less frequently. Weird.

  • Sender Mail adapter encounters MalformedInputException

    I have a sender mail adapter that processes the attached .csv file.  All is working fine.  I use FCC in module to convert the attachment and pass to an IDOC adapter for processing in SAP system.
    My problem is sometimes the sender mail CC fails with ...........
    exception caught during processing mail message[1]; com.sap.aii.af.mp.module.ModuleException: Transform: failed to execute the transformation: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException caused by: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException
    It only fails with some files.  At the moment when we test we FORWARD the email to our email account.  If I detach the failed email attachment and attach it to a NEW email it will then work.
    So why does it not work when forwarding emails?  But it works when I attach the same file to a new email and send?
    Other threads for this error seem to point to encoding.  But how do I know which to use.  I currently use the following in my module config:
    Transfer.ContentType     application/octet-stream;charset="ISO-8859-1"

    I have this in my configuration:
    localejbs/AF_Modules/PayloadSwapBean   on local
    TRANSFORM
    localejbs/AF_Modules/MessageTransformBean   on local
    txtxml
    TRANSFORM   swap.keyName   payload-name
    TRANSFORM   swap.keyValue   MailAttachment-1
    txtxml   Transfer.ContentType   application/octet-stream;charset="ISO-8859-1"
    txtxml   Transform.Class   com.sap.aii.messaging.adapter.Conversion
    txtxml   Transform.ContentDescription   MailAttachment-1
    txtxml   Transform.ContentDisposition   attachment;filename="MailAttachment-1.bin"
    txtxml   xml.conversionType   SimplePlain2XML
    txtxml   xml.documentName   MT_BCD_INVOICES
    txtxml   xml.documentNamespace   urn://federalmogul.com/BCDTRAVEL/FINGLOBCD001/00
    txtxml   xml.fieldNames   COST_CENTRE,EMPLOYEE_ID,PRODUCT_GROUP,COMP_CODE,BCD_ACCOUNT,INVOICE_DATE,TRAVELER_NAME,TRAVELER_FIRST_NAME,INVOICE_NO,AMOUNT_EXCL_VAT,CURRENCY1,AMOUNT_VAT,CURRENCY2,AMOUNT_DOC_CURRENCY,CURRENCY3
    txtxml   xml.fieldSeparator   ;
    txtxml   xml.lastFieldsOptional   YES
    txtxml   xml.processFieldNames  fromConfiguration
    txtxml   xml.structureTitle   RECORDSET

  • Sender Mail Adapter issue

    Hi All,
    We are getting this error in Sender Mail adapter.
    "exception caught during processing mail message; java.net.ConnectException: A remote host refused an attempted connect operation"
    It is a (Lotus Notes) Mail to File scenario.
    Used POP3, and gave the URL as POP:// ** .
    I have tried pinging the server and getting a good response.
    I have also tried the OS01 ans it returned a response : Program Terminated.
    I am not sure if the POP3 port is enabled.
    Are there any check points we are missing ?
    Please throw some light on this as we need to solve this asap ..
    Yashwanth
    Edited by: YashwanthSVK on Aug 2, 2011 7:18 PM

    Shabarish is right.
    This seem a connectivity issue. Try to ping Mail server from your PI System and check pop3 port.
    This document can be helpful for you:
    http://wiki.sdn.sap.com/wiki/display/XI/SMTPConfigurationinSAPXI

  • Error during configuration of Sender Mail Adapter

    Hellow All,
    I was trying to configure Sender Mail Adapter and I am getting this error.
    <b>error occured: exception caught during processing mail message; java.io.IOException: unexpected greeting response; read 220 mailrelay2.lntinfotech.com ESMTP Service (Lotus Domino Release 6.5.5) ready at Fri, 14 Jul 2006 16:11:29 +0530</b>
    Can anybody please suggest me why this error is occured and how to solve that?
    I am waiting with points, come on
    Thanks in advance,
    Sugata

    HI,
    1)Try to do with POP3
    2)Check the URL , give correct Exchange Server Name/IP address.
    3) Hope you have access to read the inbox (sometimes it will not be there)
    Than try it.
    Regards.
    Moorthy

  • Jsp mail error null pinter exception

    hi all
    below is the code to sending mail from jsp (mailer.jsp) and html form
    i get an null pointer exception in jsp when i try to get the values by
    request.getParameter("xxx");
    pls tell me how to get this done
    i dont want the files to be uploaded to the server
    here are some of the tries i did
    1) i removed the form setting of enctype="multipart/form-data"
    then the error goes but the attachments are not found
    the error is filenotfound exception
    it will be gr8 help if some one correct my code
    please help
    <%@ page import="  javax.activation.*,  java.util.*, java.io.*,
    javax.mail.internet.*,  javax.mail.* " %>
    <html>
    <head>
    <title&gtSend an email ans File with jsp page</title>
    </head>
    <body bgcolor="#C0C0C0" text="#CC0000" >
    <%
    if(request.getMethod().equals("POST")  )
      boolean status = true;
      // enter here the smtp mail server address
      // ask your ISP to get the proper name
      String mailServer = "mail.econify.com";
      String fromEmail    = request.getParameter("from");
      String toEmail      = request.getParameter("to");
      String messageEnter = request.getParameter("message");
      String fileName     = request.getParameter("theFile");
    try
        Properties props = new Properties();
        props.put("mail.smtp.host", mailServer);
        Session s = Session.getInstance(props,null);
        MimeMessage message = new MimeMessage(s);
        InternetAddress from = new InternetAddress(fromEmail);
        message.setFrom(from);
        InternetAddress to = new InternetAddress(toEmail);
        message.addRecipient(Message.RecipientType.TO, to);
        message.setSubject("Send Email with jsp");
        //message.setText(messageEnter);
        // Create the message part
        BodyPart messageBodyPart = new MimeBodyPart();
        // Fill the message
        messageBodyPart.setText(messageEnter);
           // Part two is attachment
        Multipart multipart = new MimeMultipart();
        messageBodyPart = new MimeBodyPart();
        DataSource source = new FileDataSource(fileName);
        messageBodyPart.setDataHandler(new DataHandler(source));
         System.out.println("file anem : "+fileName);
        messageBodyPart.setFileName(fileName);
        multipart.addBodyPart(messageBodyPart);
       // Put parts in message
       message.setContent(multipart);
       Transport.send(message);
    // ENCTYPE="multipart/form-data"
      catch (Exception e)
         System.out.println(e.getMessage() );
         out.println("ERROR, your message failed, reason is: " + e);
         status = false;
      if (status == true)
         out.println("Your message to " + toEmail + " was sent successfully!");
    else
    %>
    <h1>Send email and attatchment file with jsp</h1>
    <form method="post" name="mail" action="mailer.jsp" enctype="multipart/form-data">
    <table BORDER="0">
    <tr>
        <td>To :</td>
        <td><input type="text" name="to" size=24></td>
    </tr>
    <p>
    <tr>
        <td>From :</td>
        <td><input type="text" name="from" size=24></td>
    </tr>
    <p>
    <tr>
        <td>Message :</td>
        <td><TEXTAREA name="message" ROWS = "5" COLS="65"></TEXTAREA></td>
    </tr>
    <p>
    <tr>
        <td>File attachment: </td>
        <td><input TYPE="FILE" name="theFile"></td>
    </tr>
    <tr>
         <td></td>
         <td><input TYPE="submit" value="submit" name="Command"></td>
    </tr>
    </table>
    </form>
    <%
    %>
    </body>
    </html>

    hi all
    below is the code to sending mail from jsp (mailer.jsp) and html form
    i get an null pointer exception in jsp when i try to get the values by
    request.getParameter("xxx");
    pls tell me how to get this done
    i dont want the files to be uploaded to the server
    here are some of the tries i did
    1) i removed the form setting of enctype="multipart/form-data"
    then the error goes but the attachments are not found
    the error is filenotfound exception
    it will be gr8 help if some one correct my code
    please help
    <%@ page import="  javax.activation.*,  java.util.*, java.io.*,
    javax.mail.internet.*,  javax.mail.* " %>
    <html>
    <head>
    <title&gtSend an email ans File with jsp page</title>
    </head>
    <body bgcolor="#C0C0C0" text="#CC0000" >
    <%
    if(request.getMethod().equals("POST")  )
      boolean status = true;
      // enter here the smtp mail server address
      // ask your ISP to get the proper name
      String mailServer = "mail.econify.com";
      String fromEmail    = request.getParameter("from");
      String toEmail      = request.getParameter("to");
      String messageEnter = request.getParameter("message");
      String fileName     = request.getParameter("theFile");
    try
        Properties props = new Properties();
        props.put("mail.smtp.host", mailServer);
        Session s = Session.getInstance(props,null);
        MimeMessage message = new MimeMessage(s);
        InternetAddress from = new InternetAddress(fromEmail);
        message.setFrom(from);
        InternetAddress to = new InternetAddress(toEmail);
        message.addRecipient(Message.RecipientType.TO, to);
        message.setSubject("Send Email with jsp");
        //message.setText(messageEnter);
        // Create the message part
        BodyPart messageBodyPart = new MimeBodyPart();
        // Fill the message
        messageBodyPart.setText(messageEnter);
           // Part two is attachment
        Multipart multipart = new MimeMultipart();
        messageBodyPart = new MimeBodyPart();
        DataSource source = new FileDataSource(fileName);
        messageBodyPart.setDataHandler(new DataHandler(source));
         System.out.println("file anem : "+fileName);
        messageBodyPart.setFileName(fileName);
        multipart.addBodyPart(messageBodyPart);
       // Put parts in message
       message.setContent(multipart);
       Transport.send(message);
    // ENCTYPE="multipart/form-data"
      catch (Exception e)
         System.out.println(e.getMessage() );
         out.println("ERROR, your message failed, reason is: " + e);
         status = false;
      if (status == true)
         out.println("Your message to " + toEmail + " was sent successfully!");
    else
    %>
    <h1>Send email and attatchment file with jsp</h1>
    <form method="post" name="mail" action="mailer.jsp" enctype="multipart/form-data">
    <table BORDER="0">
    <tr>
        <td>To :</td>
        <td><input type="text" name="to" size=24></td>
    </tr>
    <p>
    <tr>
        <td>From :</td>
        <td><input type="text" name="from" size=24></td>
    </tr>
    <p>
    <tr>
        <td>Message :</td>
        <td><TEXTAREA name="message" ROWS = "5" COLS="65"></TEXTAREA></td>
    </tr>
    <p>
    <tr>
        <td>File attachment: </td>
        <td><input TYPE="FILE" name="theFile"></td>
    </tr>
    <tr>
         <td></td>
         <td><input TYPE="submit" value="submit" name="Command"></td>
    </tr>
    </table>
    </form>
    <%
    %>
    </body>
    </html>

  • Returning vector and null pointer exception

    Hi, I'm writing a mailing program which so far is working fine, but I have now run into a problem which is completely throwing me. My mailer needs to be able to load multiple attachments - and also to be able to deal with an HTML text which contains multiple images. In each case, what I'm trying to do is to put the attachments and the images into separate vectors and process them through an iterator. The logic, at least, I hope is correct.
    I can get my code to compile but it keeps throwing a null pointer exception a runtime. Somehow, I just can't get it to pass the vector from one part of the code to another.
    Can anyone help me? I've tried various things, none of which seem to work. My code, as it stands, is posted in a skeletal form below.
    Thanks for any ideas:
    public class MailSender
       // declare various variables, including:   
         Vector embeddedImages;
         String HTMLString;
        public MailSender()
            setup();
        private void setup()
         //this part of the program sets up the various parts of the mail  (to, from, body etc)    
          HTMLString = "blah blah blah";  //sample HTMLString   
           Vector embeddedImages = null; //is this correct?
            if (HTMLString.length() > 0)
                processHTMLString(HTMLString);
         private String procesHTMLString(String htmlText)
            Vector embeddedImages = new Vector(); // I construct my vector here, is this correct?
            //Here I process the HTML string to extract the images
            //get the file path of the image and pass it to the vector
            addToVector(imageFile);
            return HTMLString;
        public Vector addToVector(String imageFile)
            embeddedImages.add(imageFile);
            return embeddedImages;
        private void send()
            //this part does the sending of the mail
            //at some part in this method I need to get at the contents of the vector:
            //but this part isn't working, I keep getting a null pointer exception
            Iterator singleImage = embeddedImages.iterator();
            while (singleImage.hasNext())
        public static void main(String[] args)
            MailSender ms = new MailSender();
            ms.send();
            System.out.println("MailSender is done ");
    }

    >>>>while they don't have a clue on how the language and/or programming in general works.
    Thank you, salpeter, for your esteemed estimation of my programming competence.
    >>>What I'm wondering is: how come people always start building applications... blah blah
    The reason being, is that it happens to be my job.
    OK, I'm perhaps slower than most and there are things I don't yet understand but I get paid probably about a tenth of what you do (and maybe even less). I regard it as a kind of apprenticeship which, after a past life having spent twenty years packing crates in a warehouse, is worth the sacrifice. Six months ago I'd never written a line of code in my life and everything I've learned since has been from books, the good people in these forums, and a lot of patient trial and error. It's hard work, but I'll get there.
    I say this, only as encouragement to anyone else who is trying to learn java and hasn't had the benefit of IT training at school and a four year computing course at university paid for by the parents, and for whom the prohibitive cost (in both time and money) of most java courses would never allow them to get on this ladder.
    Excuse my somewhat acerbic posting, but comments such as yours tend to provoke...
    Thank you EverNewJoy for explaining this to me. I haven't had time yet to try it out, but at least the concept now is clear to me.

  • Null Pointer Exception

    Hi ,
    We are using SO_DOCUMENT_SEND_API1 this BAPI to send mails in our application.Here we are passing values to the input parameters  SENDER_ADDRESS,SENDER_ADDRESS_TYPE,COMMIT_WORK .
    and we need to pass values to the tables also.one table name in the bapi is PACKING_LIST  type SOPCKLSTI1(structure).
    we have used the following code  to pass the values to the table :
                          Sopcklsti1 input_doctype = new Sopcklsti1();
         Sopcklsti1_List maillist = new Sopcklsti1_List();
         input_doctype.setDoc_Type("RAW");
         maillist.addSopcklsti1(input_doctype);
         inputmail.setPacking_List(maillist);
    When  we are running the application it is giving us the java null pointer exception.
    Any inputs on this .
    Regards,
    Pavani

    Hi pavani,
    follow this procedure,
    1)First create object for the structure.
    2)Using this object set values to attributes.
    3)Bind this object to the node.
    4)execute the bapi.
    Regards,
    Sunaina Reddy T

  • Sender Mail Adapter

    Hi,
      I am working on Sender Mail Adapter. I have done the total configuration but unable to sucess the scenarios. In the CC monitoring, it is saying that "Not Intialised" Even though i send and receive the messages from My Lotus Notes Inbox. I activated all the objects.
    I have done the following examples:
    Transport Protocal: POP3
    Message Protocal: XIALL
    Given the URL and UserId and PWD also
    Poll Intevel: 1 (Mins)
    Adapter Status: Active
    Please help to me solve this problem. I already raised the one more thread today but didn't get solutions.
    <b>Note: Do i need to do any setting from the Lotus notes(Mail Server) to diver my messages.</b>
    Thanks in Advance,
    <b>I found the problem with SMTP Address. Can i use the SMTP Url for POP3 or IMP4 protocal. Is there any thing else because if i use the Same SMTP Address, it is giving exception</b>
    Best Regards,
    Vijay
    Message was edited by:
            Gangisetty Vijaya Bhaskarudu
    Message was edited by:
            Gangisetty Vijaya Bhaskarudu

    Hi Gangisetty,
        SMTP is the out going server(for sending mails out) while POP3 is the in coming(receiving mails) server. So for a sender channel, you need to use the POP server details not SMTP.
    cheers
    danus

  • Sender Mail Adapter - forcing content as an attachement

    Hi all,
    We are using the Sender Mail Adapter to pull emails from the inboxes of some users of an exchange server.  We use the Mail Package option.
    We have noticed that the content of the emails are by-default added as attachments when there are no real attachments to the emails.  However the content is not added as an attachment when one or more attachments are present in these emails.
    Is there a way of forcing the Sender Mail Adapter to always add the content as an attachment and keeping the other attachments as well?  and of course maintain the Mail Package message type as the main payload...?
    Many thanks,
    Aldo

    Hi Stefan,
    Thanks for your reply.  I am glad to hear that I am wrong again )
    In your opinion is it possible to force the Outlook Exchange server to add the content attachment every time?  I mean by doing some configuration on it...?
    The reason why we would like to do this is because when - in the content tag of a Mail Package message - we have MIME message parts that are of content-type text/html we are having problems in decoding the html back to a readable format.
    To do this we use the apache QuotedPrintableCodec Java class.
    This works fine when the content type of the message is just text/plain but we get an exception when we try with text/html.
    The exception we get is:
    org.apache.commons.codec.DecoderException: Invalid URL encoding: not a valid digit (radix 16): 13
    I don't know if this is because of the two character sets we have in the payload (utf-8 and iso-8859-1) or if it is for other reasons...
    If you could help me figure out how to forward any HTML email to another system in a readable format it would be great.
    Thanks for your support,
    Aldo

  • Sender Mail Adapter Configuration - Process Multiple Attachments

    Dear sirs,
    I need to process several attachments at the same mail message as individual payloads.
    In default configuration of sender mail adapter only the body of message is used as payload.
    So I added PayloadSwapBean Module at Processing Sequence and it processed the attachment I set in Module Configuration.  I'm not able to process all attachments available, just one attachment is sent to PI pipeline.
    How can I process all attachments of a single mail message?
    Thank you in advance.
    Fabio Purcino

    Hi Jose,
    We are trying to implement reading multiple attachment in sender mail adapter. 
    Our Requirement is : Reading a mail having multiple .xls files. This should be read and converted to payload .
    package multiswap;
    //import com.sap.aii.adapter.xi.ms.XIMessage;
    import com.sap.aii.af.lib.mp.module.*;
    import com.sap.aii.af.lib.trace.Trace;
    import com.sap.aii.af.sdk.xi.mo.Message;
    import com.sap.aii.af.sdk.xi.mo.MessageContext;
    import com.sap.aii.af.sdk.xi.mo.xmb.XMBMessageOperator;
    import com.sap.aii.af.sdk.xi.mo.xmb.XMBPayload;
    import com.sap.aii.af.sdk.xi.util.PayloadType;
    import com.sap.aii.af.service.auditlog.Audit;
    import com.sap.aii.af.service.cpa.*;
    import com.sap.engine.interfaces.messaging.api.MessageDirection;
    import com.sap.engine.interfaces.messaging.api.MessageKey;
    import com.sap.engine.interfaces.messaging.api.Payload;
    import com.sap.engine.interfaces.messaging.api.auditlog.AuditLogStatus;
    import java.util.Hashtable;
    import java.util.Iterator;
    import java.util.Locale;
    import javax.ejb.*;
    public class MultiSwapRead
        implements SessionBean, Module
        private static final String VERSION_ID = "$Id: //tc/xpi.af/NW731EXT_07_REL/src/_af_application_ejb_module/ejbm/api/com/sap" +
    "/aii/af/app/modules/PayloadSwapBean.java#1 $"
        private static final Trace TRACE = new Trace("$Id: //tc/xpi.af/NW731EXT_07_REL/src/_af_application_ejb_module/ejbm/api/com/sap" +
    "/aii/af/app/modules/PayloadSwapBean.java#1 $"
        private static final String SIGNATURE_PROCESS = "process(ModuleContext , ModuleData)";
        protected Hashtable cachedChannels;
        protected SessionContext myContext;
        public MultiSwapRead()
            cachedChannels = new Hashtable();
        public void ejbRemove()
        public void ejbActivate()
        public void ejbPassivate()
        public void setSessionContext(SessionContext context)
            myContext = context;
        public void ejbCreate()
            throws CreateException
        public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData)
            throws ModuleException
            if(TRACE.beLogged(200))
                TRACE.entering("process(ModuleContext , ModuleData)", new Object[] {
                    moduleContext, inputModuleData
            ModuleData outputModuleData;
            Iterator itr;
            outputModuleData = inputModuleData;
            String chid = moduleContext.getChannelID();
            TRACE.infoT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, (new StringBuilder()).append("performing payload swap for channel ").append(chid).toString());
            LookupManager lman = LookupManager.getInstance();
            Channel chan = null;
      try {
      chan = (Channel)LookupManager.getInstance().getCPAObject(CPAObjectType.CHANNEL, chid);
      } catch (CPAObjectNotFoundException e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
      } catch (CPAException e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
            Direction direction = chan.getDirection();
            String swapkey = moduleContext.getContextData("swap.keyName");
            String keyvalue = moduleContext.getContextData("swap.keyValue");
            Object obj = inputModuleData.getPrincipalData();
            Object pivotedObj = inputModuleData.getSupplementalData("mp.pivoted");
            boolean pivoted = pivotedObj == null || !(pivotedObj instanceof Boolean) ? false : ((Boolean)pivotedObj).booleanValue();
            Message mo = null;
            if(obj instanceof com.sap.engine.interfaces.messaging.api.Message)
                mo = (Message)((com.sap.engine.interfaces.messaging.api.Message)obj);
            } else
            if(obj instanceof MessageContext)
                mo = ((MessageContext)obj).getMessage();
            } else
                TRACE.warningT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, "no message found");
            if(mo != null && XMBMessageOperator.numberOfPayloads(mo) > 0)
               // String midstr = XMBMessageOperator.getMessageId(mo).toString();
                MessageKey auditkey = new MessageKey(((com.sap.engine.interfaces.messaging.api.Message) mo).getMessageId(), com.sap.engine.interfaces.messaging.api.MessageDirection.INBOUND);
                itr = (Iterator) mo.getAttachments();
                if(swapkey != null && keyvalue != null)
                    StringBuffer textSwappingbyBuf = new StringBuffer();
                    textSwappingbyBuf.append("Swap: swapping by '").append(swapkey).append("' ? '").append(keyvalue).append("'");
                    String textSwappingby = textSwappingbyBuf.toString();
                    TRACE.infoT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, textSwappingby);
                    Audit.addAuditLogEntry(auditkey, AuditLogStatus.SUCCESS, textSwappingby);
                   while (itr.hasNext()){
                    boolean swappedp = swapPayloads(mo, swapkey, keyvalue);
                    String swappedStatus = swappedp ? "Swap: successfully swapped" : "Swap: no matching payload found";
                    Audit.addAuditLogEntry(auditkey, AuditLogStatus.SUCCESS, swappedStatus);
                } else
                    StringBuffer textInvalidBuf = new StringBuffer();
                    textInvalidBuf.append("Swap: parameter missing ");
                    if(swapkey == null)
                        textInvalidBuf.append("swap.keyName");
                    if(swapkey == null && keyvalue == null)
                        textInvalidBuf.append(" and ");
                    if(keyvalue == null)
                        textInvalidBuf.append("swap.keyValue");
                    String textInvalid = textInvalidBuf.toString();
                    TRACE.warningT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, textInvalid);
                    Audit.addAuditLogEntry(auditkey, AuditLogStatus.WARNING, textInvalid);
            } else
                String messageEmpty = "Swap: message is empty or has no payload";
                TRACE.infoT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, messageEmpty);
            return outputModuleData;
        private static boolean swapPayloads(Message mo, String swapkey, String keyvalue)
            swapkey = swapkey.toUpperCase(Locale.ENGLISH);
            keyvalue = keyvalue.toUpperCase(Locale.ENGLISH);
            int ifound = -1;
            for(int i = 0; i < XMBMessageOperator.numberOfPayloads(mo); i++)
                XMBPayload pldi = XMBMessageOperator.getPayload(mo, i);
                String pldivalue = null;
                if(swapkey.equals("PAYLOAD-DESCRIPTION"))
                    pldivalue = pldi.getPayloadDescription();
                } else
                if(swapkey.equals("PAYLOAD-NAME"))
                    pldivalue = pldi.getPayloadName();
                } else
                    pldivalue = pldi.getContentAttribute(swapkey);
                if(pldivalue == null)
                    continue;
                pldivalue = pldivalue.toUpperCase(Locale.ENGLISH);
                if(pldivalue.indexOf(keyvalue) < 0)
                    continue;
                ifound = i;
                break;
            if(ifound >= 0)
                XMBPayload pldfound = XMBMessageOperator.getPayload(mo, ifound);
                if(pldfound.getPayloadType() != PayloadType.APPLICATION)
                    XMBPayload pldapp = XMBMessageOperator.getApplicationPayload(mo);
                    if(pldapp == null)
                        pldfound.setPayloadType(PayloadType.APPLICATION);
                    } else
                        pldapp.setPayloadType(PayloadType.APPLICATION_ATTACHMENT);
                        pldfound.setPayloadType(PayloadType.APPLICATION);
                    TRACE.infoT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, "successfully swapped");
                return true;
            } else
                TRACE.warningT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, "no matching found");
                return false;
    We couldn't go further. Please have a look in highlighted code.
    Regards,
    Kesava.

  • Sender Mail Adapter - S/MIME - How to use it?

    Hi guys,
    I am trying to figure out how to use the S/MIME security parameter of the Sender Mail Adapter in PI 7.1.
    Could anyone point me to some useful documentation/examples/blogs ?
    Or perhaps explain what steps are involved when configuring this parameter?
    We are pulling emails from an Microsoft Exchange server.
    Many thanks,
    Aldo

    First of all one sender mail adapter has to be tight with a specific sender email address.
    The email has to be decrypted as whole, you cannot decrypt parts of it.
    Then you store certificates to secure store in J2EE server and point to it in send agreement, this should be equal to HTTPS setup
    Check security guide:
    http://help.sap.com/saphelp_nwpi71/helpdata/EN/f7/c2953fc405330ee10000000a114084/frameset.htm

Maybe you are looking for

  • Printing/View options for iCal

    Is there any way to only view content on the weekends, in a printer ready format? Is there a way to only print specific dates (for example weekends only) to view on a print out?

  • Video out to tape woes

    Now I have an HD TV I thought I'd try to output finished sequences back to the camera, to play on the TV via HDMI. But I can't get FCE (3.5.1) to write correctly to the camera, a Sony FX7E. Print to video just puts the colour bars and countdown onto

  • Can't fax using HP7510 due to error message "not connected to network".

    I am having trouble with efax.  It has worked in the past with no issues.  Now I get a message that the printer is not connected to the nework even though it is.  I can print wirelessly. The issue is with faxing.   I have tried all suggestions I have

  • Upgrade from 3gs to 4s ? Sim card

    Anyone know how Apple deals with upgrading from the mini SIM in the 3GS to the micro SIM in 4 and 4S? If I have a 3GS with it's old mini-SIM in it and pre-order a 4S from Apple for home delivery, will the new phone have a new micro SIM in it when it

  • Ugent native compoenent in applet

    I have written an applet which uses jdic browser on Windows platform (InternetExplorer). So I have a browser in a browser :-) But while loading i get always an exception : org.jdesktop.jdic.init.JdicInitException: java.lang.UnsatisfiedLinkError: no j