How to fetch message comments using JMA API?

Hi All,
From telnet <host> 143, and tring get comments associated with a message works well as shown below.
2 fetch 8 COMMENT ("/message/vendor/ms/follow-up-flag-status" ("value.shared"))
* 8 FETCH (COMMENT ("/message/vendor/ms/follow-up-flag-status" ("value.shared" "completed")))
How to fetch the same details using Java Mail API. I couldn't get any of these flags when added to FetchProfile before fetching. The last option is using IMAPFolder.ProtocolCommand.
Please suggest if there is a better way to fetch message meta data as "comment" using JMA
Regards,
Venkat

I don't know what JMA is. I assume you meant JavaMail.
Sorry, there's no direct support for fetching that data.
You might be able to get this to work using IMAPFolder.ProtocolCommand.

Similar Messages

  • How to fetch messages using IMAPFolder ?

    Dear Friends,
    Anybody knows how to show messages with IMAPFolder ?
    Thank u.
    Chirag Patel

    I have never seen the class IMAPFolder. Here is a class I wrote that returns a table row that has message information from a folder.
    Use the messagelist method and pass in the folder you want along with the connection url to your server.
    =======================================================================
    =======================================================================
    import java.util.*;
    import java.util.Properties;
    import java.net.*;
    import java.io.*;
    import java.lang.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    public class EmailListMessages {
         static String outputString = "";
         public String timeoutVal = "5000";
         public String messagelist(String mbox, String url, int timeout) throws Exception {
              timeoutVal = timeout + "";
              return messagelist(mbox,url);
         public String messagelist(String mbox, String url) throws Exception{
              int optind;
         int port = -1;
         boolean verbose = false;
         boolean debug = false;
         boolean showStructure = false;
              Store store = null;
              outputString = "";
              try {
              // Get a Properties object
              Properties props = System.getProperties();
                   props.put("mail.imap.connectiontimeout",timeoutVal);
                   props.put("mail.imap.timeout",timeoutVal);
              // Get a Session object
              Session session = Session.getDefaultInstance(props, null);
              session.setDebug(debug);
              // Get a Store object
                   URLName urln = new URLName(url);
                   store = session.getStore(urln);
                   store.connect();
         } catch (Exception e) {outputString = "Error:Host Connection";}
              // Open the Folder
              Folder folder = store.getDefaultFolder();
              if (folder == null) {
         outputString = "No default folder error";
                   return outputString;
         folder = folder.getFolder(mbox);
         if (folder == null) {
         outputString = "Invalid folder error";
                   return outputString;
         // try to open read/write and if that fails try read-only
         try {
                   folder.open(Folder.READ_WRITE);
         } catch (MessagingException ex) {folder.open(Folder.READ_ONLY);}
         int totalMessages = folder.getMessageCount();
         if (totalMessages == 0) {
                   outputString = "(No Messages)";
                   folder.close(true);
                   store.close();
                   return outputString;
              // Attributes & Flags for all messages ..
              Message[] msgs = folder.getMessages();
              // Use a suitable FetchProfile
              FetchProfile fp = new FetchProfile();
              fp.add(FetchProfile.Item.ENVELOPE);
              fp.add(FetchProfile.Item.FLAGS);
              fp.add("X-Mailer");
              folder.fetch(msgs, fp);
              for (int i = 0; i < msgs.length; i++) {
              dumpEnvelope(msgs,mbox);
              folder.close(false);
              store.close();
              return outputString;
         public static void dumpEnvelope(Message m, String mbox) throws Exception {
              String fromString = "";
              String subjectString = "";
              String dtString = "";
              String flagString = "";
              Address[] a;
              int msgNumber = m.getMessageNumber();
              if (mbox.equals("Sent"))
                   // TO
                   if ((a = m.getRecipients(Message.RecipientType.TO)) != null) {
                   for (int j = 0; j < a.length; j++)
                        fromString = a[j].toString();
                   fromString = ("<td><a href='EmailViewMessage.jsp?messageNumber=" + msgNumber + "&folderName=" + mbox + "'>" + fromString + "</a></td>");     
              else
                   // FROM
                   if ((a = m.getFrom()) != null) {
                   for (int j = 0; j < a.length; j++)
                        fromString = a[j].toString();
                   fromString = ("<td><a href='EmailViewMessage.jsp?messageNumber=" + msgNumber + "&folderName=" + mbox + "'>" + fromString + "</a></td>");     
              // SUBJECT
              subjectString = m.getSubject();
              subjectString = ("<td>" + subjectString + "</td>");
              // DATE
              Date d = m.getSentDate();
              dtString = "UNKNOWN";
              if (d != null) dtString = d.toString();
              dtString = ("<td>" + dtString + "</td>");
              // FLAGS
              Flags flags = m.getFlags();
              StringBuffer sb = new StringBuffer();
              Flags.Flag[] sf = flags.getSystemFlags(); // get the system flags
              boolean first = true;
              for (int i = 0; i < sf.length; i++) {
              String s;
              Flags.Flag f = sf[i];
              if (f == Flags.Flag.ANSWERED)
                   s = "\\Answered";
              else if (f == Flags.Flag.DELETED)
                   s = "\\Deleted";
              else if (f == Flags.Flag.DRAFT)
                   s = "\\Draft";
              else if (f == Flags.Flag.FLAGGED)
                   s = "\\Flagged";
              else if (f == Flags.Flag.RECENT)
                   s = "\\Recent";
              else if (f == Flags.Flag.SEEN)
                   s = "\\Seen";
              else
                   continue;     // skip it
              if (first)
                   first = false;
              else
                   sb.append(' ');
              sb.append(s);
              String[] uf = flags.getUserFlags(); // get the user flag strings
              for (int i = 0; i < uf.length; i++) {
              if (first)
                   first = false;
              else
                   sb.append(' ');
              sb.append(uf[i]);
              flagString = sb.toString();
              String testString = "\\Seen";
              if (!flagString.equals(testString))
                   flagString = ("<td>New</td>");
              else
                   flagString = ("<td> </td>");
              outputString = (outputString + "<tr bgcolor='#a9a9a9'>" + fromString + subjectString + dtString + flagString + "</tr>");

  • How to Ship Partial Quantities using an API - Oracle Order Management

    Hi,
    In Order Management I need to ship the Internal Sales Order Lines partially using an API.
    I have done full shipping but if I trying the partially shipping it is also shipping fully.
    I am unable to find the problem. Is there any set up missed?
    How to do partial shipping.
    I am giving the some part of the code please look into it and suggest me.
    ----**************************UPDATEING SHIPIN ATTR ***************************-------------
    I_changed_attributes (X_count).delivery_detail_id := cos.delivery_detail_id;
    I_changed_attributes (X_count).shipped_quantity := cos.shipped_quantity;
    X_ship_date := cos.act_shipped_date;
    X_slaes_order := cos.sales_order;
    X_org_id := cos.org_id;
    wsh_delivery_details_pub.update_shipping_attributes ( p_api_version_number => 1.0
    ,p_init_msg_list => I_init_msg_list
    ,p_commit => I_commit
    ,x_return_status => O_return_status
    ,x_msg_count => O_msg_count
    ,x_msg_data => O_msg_data
    ,p_changed_attributes => I_changed_attributes
    ,p_source_code => I_source_code
    ----***************************SHIP CONFIRM API ***************************-------------
    I_action_code := 'CONFIRM';
    I_sc_action_flag := 'B'; --'S'; -- Ship entered quantity. 'B' - Ship Entered Quantities, Backorder Unspecified
    --'T' - Ship Entered Quantities, Stage Unspecified'A' - Ship All'C' - Completely Backordered
    I_sc_intransit_flag := 'Y';
    --In transit flag is set to 'Y' closes the pickup stop and sets the delivery in transit.
    I_sc_close_trip_flag := 'Y'; -- Close the trip after ship confirm
    I_sc_trip_ship_method := X_ship_method_code; -- The ship method code
    I_sc_defer_interface_flag := 'Y';
    I_sc_stage_del_flag := 'Y';
    I_sc_create_bol_flag := 'N';
    I_wv_override_flag := 'N';
    -- API Call for Ship Confirmation
    fnd_file.put_line(fnd_file.log,'Calling WSH_DELIVERIES_PUB to Perform Ship Confirmation');
    fnd_file.put_line(fnd_file.log,'=============================================');
    wsh_deliveries_pub.delivery_action ( p_api_version_number => 1.0
    , p_init_msg_list => I_init_msg_list
    , x_return_status => O_return_status
    , x_msg_count => O_msg_count
    , x_msg_data => O_msg_data
    , p_action_code => I_action_code
    -- , p_delivery_id => cos.delivery_id
    , p_delivery_name => G_delivery_name
    , p_sc_action_flag => I_sc_action_flag
    , p_sc_intransit_flag => I_sc_intransit_flag
    , p_sc_close_trip_flag => I_sc_close_trip_flag
    , p_sc_create_bol_flag => I_sc_create_bol_flag
    , p_sc_stage_del_flag => I_sc_stage_del_flag
    , p_sc_trip_ship_method => I_sc_trip_ship_method
    , p_sc_actual_dep_date => X_ship_date --P_act_shipped_dt
    , p_sc_defer_interface_flag => I_sc_defer_interface_flag
    , p_wv_override_flag => I_wv_override_flag
    , x_trip_id => O_trip_id
    , x_trip_name => O_trip_name
    ----***********************************************************************--------------------

    Hi Shesh,
    Thanks you for your replay.
    I am tried Shipping transaction screen but here the ware house is WMS enabled I tried Oracle Mobile Terminal application to do this, but it is not accepting the partial shipping. May be some set up required or the process will be differ.
    I will try your suggested API's .
    Regards,
    Prasanna
    Edited by: 843676 on Apr 23, 2012 10:31 PM
    I am not able to do the Partial Shipment or Backorder as mentioned above API's, but it is split the lines and all the lines are in same state (Awaiting Shipping)
    Edited by: 843676 on Apr 24, 2012 2:45 AM

  • How to split messages without using Message split (BPM)

    In file to file scenario how to split messages coming from file without using Message split (BPM)

    Thank you very much.

  • How to send automated mail using Weblogic API ,,,,,, NOT Java Mail API.

    Hi All,
    I need to send an automated mail using BEA Weblogic API, can you please let me know how to accomplish this task,
    I will be heartly thankful to you,
    waiting for your response back
    naveen

    does it uses weblogic API ,, is thre any other way to do the task apart from email controls ,,,, because we are using timers and email control uses event genrators.

  • How to create Downpayment Invoice using DI API in SAP B1 2005 version?

    Hi there,
    I appreciate anyone that can suggest me how to create a down payment invoice using DI API in SAP B1 2005 version? What is the object that we need to use? I can't find any object to achieve this
    Many Thanks,
    Harianto Ng

    the object is SAPbobsCOM.BoObjectTypes.oDownPayments, but if i remember correctly this object wasnt exposed in DI for 2004 and maybe for 2005 too.

  • How to invoke the JwscTask using Ant Api

    Hi,
    I need to invoke the weblogic JwscTask <jwsc> from a java class using Ant API, one way to do this is to write a build.xml file with the specified ant task and use the appropriate Ant api, whereas my requirement is to directly create a Task object and run the task how should one go about doing the same as the JWSCTask API is not open.
    Thanks in advance
    Regards,
    Preethi

    Hi,
    I will agree with Martin on first you should take a step back and see the business drive for the use case but stil if you have to do it below is my thought to fire disable/enable task.
    1.Insteed of firing a particular enable/disable task its better to enable/disable the resource.
    2.To enable/disable the object instance you can use enableAppForUser()/disableAppForUser() method of tcUserOperationIntf which will in end will fire enable and disable task.
    To kick of update task I will suggest to update the form field usingsetProcessFormData() method if tcFormInstanceOperationsIntf which will in result will kick of the update task.
    Hope this will help.
    Regards
    Nitesh

  • How to access Task details using BPM API for substituting user

    Hi Expert,
    I need one help, we have a requirement, in which I wanted to access the BPM task details of a user which is substituting user using BPM API.
    Substituting user's name is not exist in Potential owner of Task. That’s why Using method "getMyTaskAbstracts(Status)" we cant acess those task which assigned by Substited user.
    Kindly let me know if there is any way, we can get task details of the task which assigned by substituted user to substituting user.
    Regards
    Div

    Pl use this api.
    getTaskAbstractsForMySubstitutedUsers.There are couple of variations u can use.
    Thanks
    Manish

  • How to read inline feed using android api for odata

    Hi,
    Need help on reading inline feed using android api. BB and iOS supports inline but for android there is no api.
    Please suggest the workaround
    Regards,
    Satish

    This link is very useful:
    Knowledge Management and Collaboration (KMC)
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/kmc/Knowledge%20Management%20and%20Collaboration%20Developers%20Guide.html
    Patricio.

  • How to install OID connector using OIM API in 11g?

    Hi All,
    We are using OID connector in OIM 11g environment. It is a simple process to install OID connector by unzipping the connector zip file to ConnectorDefaultDirectory and goto Admin console and load the connector.
    However, we are looking for API methods to simulate "load the connector " step in GUI.
    Please help.
    Thanks
    Mahendra.

    Hey Mahendra,
    I am not aware of this API to do the 'Deployment Manager' load task. But III try to help you using another way:
    1-You can use ICF API to do this task(creating it specifically to OID). Using ICF: http://www.groenenberg.nu/Oracle_Doc/AS_11.1.1.5/doc.1111/e14309/icf.htm#BABFDJHJ
    2- And following this example that my buddy did for Open DS: http://itnaf.org/2011/12/30/developing-icf-connectors/
    Another helpful doc: http://docs.oracle.com/cd/E14571_01/doc.1111/e14309.pdf
    I hope this helps,
    Thiago Leoncio.

  • How to create RMA lines using OE_ORDER_PUB API

    Hi All,
    We are trying to create RMA lines using OE_ORDER_PUB API but every time API creating <b>Standard Order Line</b> line type in application.
    My program is creating order header as a <b>Return Order</b>, i am passing corrent line type ids (1028 - RMA Shipment, 1027 - RMA Receipt) but oracle API is creating Standard Order Lines (ID 1001).
    Can any one tell me about that?
    Thanks
    Ravi
    null

    Check the defaulting rules setup. Defaulting rule will derive the line type based on the order type and shippable flag etc.
    Also check the line flows assigned to the order type in transaction types window.
    Thanks / Bhaskar Akkala

  • How reset Acrobat form field using javascript API

    How reset Acrobat form field using javascript API

    There are several ways:
    resetForm(["Text1"]);
    or
    getField("Text1").value = getField("Text1").defaultValue;
    George

  • How to create numeric attribute using ABAP API

    Hi experts
    I'm trying to create a numeric attribute for a taxonomy table. In the how-to-examples there are only ways to create text attributes.
    Those who have tried, please let me know the steps.
    I have given below the code snippet which i tried to create numeric attribute. Please let me knw the missing link.
    ls_num_attr_val-rating = 500.
        APPEND ls_num_attr_val TO ls_ext_attr_info-characteristics.
      ls_ext_attr_info-attr_info-attr_id-id = lv_attribute_id.
           APPEND ls_ext_attr_info TO lt_ext_attr_info.
        GET REFERENCE OF lt_ext_attr_info INTO lv_data.
        ls_namevalue-value = lv_data.
        ls_namevalue-code = 'ACCT'.
        APPEND ls_namevalue TO ls_parameter-name_value_pairs.
        lv_string = 'Customer 12'.
        GET REFERENCE OF lv_string INTO lv_data.
        ls_namevalue-value = lv_data.
        ls_namevalue-code = 'CUST_NAME'.
        APPEND ls_namevalue TO ls_parameter-name_value_pairs.
        CALL METHOD lr_api->mo_core_service->create
          EXPORTING
            iv_object_type_code = 'ACCT_TYPE'
            is_parameter        = ls_parameter
            iv_parent_id        = 0
          IMPORTING
            ev_new_internal_id  = lv_key.
    Thanks
    SwarnaDeepika
    Edited by: SwarnaDeepika on Dec 19, 2009 4:38 PM

    Hello Ashok,
    [here|https://help.sap.com/javadocs/MDM/current/com/sap/mdm/examples/CreateField.html] is the Java API of the needed command.
    There is also an example of how to create a field. You can use the class by replacing the strings for the server, repository, table, etc. to your needs.
    If you want to create more than one field, simply use a loop, like the for-loop, while-loop, etc.
    Hope this helps.
    Best regards
    Dominik

  • How to fetch any Hardware using Java

    Hi! Friends
    I wanna switch off my bedroom light through my laptop
    how to code in java for it please give me a little example
    if any suggetion please mail me [email protected]
    thanx
    S M Hasan
    Message was edited by:
    hasan-mobile

    Well, the problem is that a laptop cannot really "connect" to a light or light switch. In any way. No way.
    If your lights come with one of those neato remotes, there is a solution. Tape/glue the remote to the lid of your laptop, and once you close the laptop, push the "power" button on your remote. That should do the trick.
    Otherwise, you have to rewire your lights to go through some sort of mechanism that can be controlled using a neato remote. Then refer to the method listed above :D
    I'm not kidding one bit.

  • How to fetch billing number using delivery number

    Hi Experts,
    Based on delivery number(LIPS-VBELN) i need to get the data from billing table(VBRK and VBRP).
    Is there any function module to get the same. Pls anyone help on this.
    Thanks
    Ramesh Manoharan
    Moderator message: please do some research before asking.
    Edited by: Thomas Zloch on Mar 2, 2011 9:16 AM

    Hi ,
    My requirement is to fetch the check number from payr table using CHECT field .
    but relation ship i taken from bseg table.
    i am giving query as follows
    select single chect from payr into a_chect where vblnr = bseg-belnr.
    above query is not giving solution.
    is there any other relation ship for getting check number.
    i  written  subroutine program for calling into form .
    form  check_get tables in_tab structure itcsy
                          out_tab structure itcsy.
    tables: payr.
    data:  a_chect type payr-chect,
           b_belnr type bseg-belnr.
    read table in_tab INDEX 1.   "with key NAME = 'BSIK-BELNR'.
           check sy-subrc = 0.
    b_belnr   =    in_tab-value.
    break-point.
    select single CHECT from PAYR into A_CHECT where vblnr = b_belnr.
    if sy-subrc = 0.
    read table out_tab index 1. "with key 'CHECT'.
    check sy-subrc = 0.
    out_tab-value = a_chect.
    modify out_tab index 1.
    endif.
    endform.

Maybe you are looking for

  • Acrobat X Pro not opening - Part II

    I previously posted on this topic on April 19 and 20 (see http://forums.adobe.com/message/5253051#5253051), but surprisingly, received no responses. I am now reposting because the problem continues and I have been unable to find a satisfactory soluti

  • How do you watch an iMovie with this 11inch macbook air?!!?

    I have a research project for class and I made a short documentary on imovie... Now I know I can view it on my mac but how can i make dvds? or let alone present it to my class (i.e. dvd) my school does not use macs, so asking IT was useless. Basicall

  • Flash player install error

    I have gone through the clean install process for Flash player on Mac OS X (10.9.5) a few times, it is still failing. Any help figuring this out would be greatly appreciated. Here is the log: 2014-11-28 15:46:04 -0600 [I]  IM: ---------- log start --

  • Traditional ACL vs Zone Based FW

    I have a 3845 ISR that I have been managing for a couple years that has a traditional ACL based config.  We just purchased a new 3845 for redundancy and it arrived with the zone based config from Cisco.  Any opinions on whether I should take the exis

  • Create File Table for Existing UNC Paths ?

    Hi, I have a files with in the server ( //Server1/Folder1) and (//server1/Folder2). Now If I am create FileTable Database in the server ( server2 ) and how can I give filename path ? Example : I am going to create FileTableDB database in the server2