Unable to read Diagnostic Code using MessageHeaders/InternetHeaders

I'm trying to read "Diagnostic-Code" Header using the following code:
+{color:#0000ff}MessageHeaders messageHeaders=new MessageHeaders(part2.getInputStream());+
+ Enumeration iheaders=messageHeaders.getAllHeaders();+
+ while(iheaders.hasMoreElements())+
+ {+
+ Header header=(Header)iheaders.nextElement();+
+ System.out.println("InternetHeaders : "+header.getName()+": "+header.getValue());+
+ }{color}+
Message contains the following:
{color:#008000}*--nBSIUV3H002931.1262025031/**dummyserver.net*{color}
Content-Type: message/delivery-status
*{color:#0000ff}Reporting-MTA:{color} dns; dummyserver.net*
*{color:#0000ff}Received-From-MTA:{color} DNS; localhost*
*{color:#0000ff}Arrival-Date:{color} Mon, 28 Dec 2009 13:30:30 -0500 (EST)*
*{color:#ff0000}Final-Recipient: {color}RFC822; [email protected]*
*{color:#0000ff}{color:#ff0000}Action:{color}{color} failed*
*{color:#ff0000}Status: {color}5.3.0*
*{color:#ff0000}Remote-MTA:{color} DNS; dummyserver.net*
*{color:#ff0000}Diagnostic-Code:{color} SMTP; 553 5.3.0 <[email protected]>... Unknown user - sorry.*
*{color:#ff0000}Last-Attempt-Date:{color} Mon, 28 Dec 2009 13:30:31 -0500 (EST)*
*{color:#008000}--nBSIUV3H002931.1262025031/dummyserver.net
{color}*
But the above Code is able to read only the first three headers in {color:#0000ff}*blue*{color} and not the ones in *{color:#ff0000}red{color}*.
The reason seems to be the blank line which is being considered as end of headers.
Please suggest how to read "Diagnostic-Code
" without reading the stream and matching pattern.

Try using the DSN support included with JavaMail.
As described in [NOTES.txt|http://java.sun.com/products/javamail/NOTES.txt], add dsn.jar to your CLASSPATH.
See the javadocs for the [com.sun.mail.dsn.DeliveryStatus|http://java.sun.com/products/javamail/javadocs/com/sun/mail/dsn/DeliveryStatus.html] class.

Similar Messages

  • I am unable to read the code after scratching itunes card

    i am unable to read the code on the itunes card

    http://www.apple.com/support/itunes/cards-codes/
    Maybe this item from that page? iTunes Store: Invalid, inactive, or illegible codes
    Message was edited by: EZ Jim

  • Unable to read the file using UTL_FILE Dir

    I need to read/write a file from/to the operating system through PLSQL Package. I used UTL_FILE package to do the same. In the application server the utl_file_dir(/usr/tmp in my system) is created as a softlink to database server.
    oI want to run this package through the application server. However I am unable to read and write the file to the operating system.
    I just wondering it is not reading/opening the file from the server. Please suggest me how to modify my code.

    Hi,
    How to check if it is end of file or not? I have the following function which is working fine in my win2003 server std 32bit and Oracle10g Database R2 Standard Edition one 32bit. HOwever, when I deploy to production server which is 64bit OS and database, it gives error at UTL_FILE.GET_LINE(fptr, tmp);
    Any idea why it behaves like that?
         FUNCTION readFile (
              inHTML OUT CLOB,
              path IN VARCHAR2,
              htmlFile IN VARCHAR2
         ) RETURN BOOLEAN IS
         fptr utl_file.file_type;
         tmp VARCHAR2(5023);
         bufferlen BINARY_INTEGER;
         BEGIN
              fptr := UTL_FILE.FOPEN(path, htmlFile, 'r');
              DBMS_LOB.CREATETEMPORARY(inHTML, TRUE);
              DBMS_LOB.OPEN(inHTML, DBMS_LOB.LOB_READWRITE);
              LOOP
                   UTL_FILE.GET_LINE(fptr, tmp);
                   if tmp is not null then
                        tmp := tmp || CHR(10);
                        bufferlen := LENGTH(tmp);
                        DBMS_LOB.WRITEAPPEND(inHTML, bufferlen, tmp);
                   end if;
              END LOOP;
              WHEN NO_DATA_FOUND THEN
              DBMS_LOB.CLOSE(inHTML);
                   UTL_FILE.FCLOSE(fptr);
                   RETURN TRUE;
              WHEN OTHERS THEN
                   DBMS_LOB.CLOSE(inHTML);
                   DBMS_LOB.FREETEMPORARY(inHTML);
                   RETURN FALSE;
         END readFile;

  • Unable to read/write bytes using 9870 with cRio 9151

    Hi everyone,
    I'm currently having some problems trying to use 2 ports of module NI 9870. I'm unable to read bytes even if I try to send some datas (I always get a Timeout) and I'm also unable to write some datas( I can't see nothing on Hyperterminal).
    Please find enclosed a snapshot of my Fpga code.
    Regard,
    Nicolas Kaminski, Toulouse France
    Attachments:
    ReadBytes.jpg ‏93 KB
    WriteBytes.jpg ‏30 KB

    Hello,
    Can you give us some other details:
    Are you sure that you provide power to the 9870 module?
    Do you have tested your system with an example? (NI-987x Serial Loopback.lvproj)
    DO you get something through that loopback?
    Regards,
    Mathieu P. | Certified LabVIEW Associate Developer
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    Journées techniques : des fondamentaux aux dernières technologies pour la mesure et le contrôle/comm...

  • Unable to read values populated using Java Script

    hi Experts,
    we generated a BSP Page through some SPRO setting it contains HTML and ABAP scripts.
    in that we have 2 select - option - dropdowns. i first one is being populated by ABAP script. second one is being populated by java script.
    the BSP page is working fine. but i am unable to read the second dropdown value using a class method
    we call this class method in the BADI : CRM_SERVICE_WEBREQ. method : FORM_ON_EVENT
      CALL METHOD cl_uxs_xml_services=>get_value_via_xpath
      EXPORTING
        ir_node                   = ir_form_data
        id_xpath                  = 'secondChoice'
         id_xpath_namespace_uri    =
         id_xpath_namespace_prefix =
         id_multi_namespace        =
      RECEIVING
        rd_value                  = lv_value
      EXCEPTIONS
        not_found                 = 1
        not_unique                = 2
        OTHERS                    = 3
    but i am able to read other fields in the page. i am not sure but i changed the id and name on the second drop down.
    pls let me know how to read the value for second drop down.

    Hi Ben Grice,
    ASP.NET questions should be post in
    ASP.NET forums. You can get better help there.
    Thanks for your understanding.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Unable to read 5th channel using cDAQ 9178 with NI 9219 modules

    Dear LabView user,
    I've made a VI for reading the measurements of a couple of LVDT sensors, a load cell and a couple of strain gauges. When I connect 4 of these sensors to my cDAQ 9178 with using 1 slot of NI 9219, then there is no problem for my VI. But if I use 2 modules, and connect the 2 LVDT sensors and the load cell to the first module, and the 2 strain gauges to the 2nd module, then my program only will show the readings of the first module and the readings of only 1 strain gauge on the 2nd module. I've found that there occurs an error for the 5th channel in the 'zero' state. It says my buffer size is too small... How can I solve this problem? I can't work with finite samples because it is a continious measurement. 
    I also have the cDAQ 9171 USB module, if I only connect 4 sensors to this module, the sample rate is high (100 Samples/sec), when I use the same configuration, but connect this with the cDAQ 9178, the sample rate is much lower however I use the same NI 9219 module to fill the slots. Is there some kind of setting I need to make when switching over to the cDAQ 9178?
    I've attached my VI.
    With kind regards,
    Pete

    Dear RavensFan, 
    Thank you for your answer.
    "Have you tried swapping the modules between the slots and see if you still have the same problem or if it moves?"  When I use the cDAQ 9178, I always use the first 2 slots next to the power suply and the usb connection, you mean that I should try for example the 4th and the 5th slot or other slots? I will try this on Monday, and I will let you know.
    About the states machines inside a state: How is it possible then to use several buttons, like start and stop measurement and the 'home' button inside the state "measurement"? Should I make another simple state machine inside this state? 
    What about that 5th channel that I'm unable to read? The problem happens in my "zero" state: to acquire my "zero elements", the loop does the job for the 5 channels for the first 8 samples, after that, it doesn't want to sample the 5 channels anymore, it only does for 4 channels... It's something about the buffer size, but I don't know how to fix that.
    With kind regards,
    Peter

  • I am unable to read pdf files using Acrobat Reader on my MAC OS X. Any suggestions?

    How do I read pdf files using my MAC OS X?

    You can read pdf files with preview. Select a pdf document, right click on it, and choose Preview. You can also get info and select to choose Preview for all.
    You can also install Adobe Reader 10.1.3 for Lion. It will also install a plug-in to read pdf docs in the browser.
    http://www.adobe.com/support/downloads/detail.jsp?ftpID=5360

  • Unable to read ITResource details using Platform class

    Hi,
    When I try to read the ITResource parameters using Platform class, it says ITResource does not exist, code below:
    tcITResourceInstanceOperationsIntf itTResourceOperationsIntf=Platform.getService(tcITResourceInstanceOperationsIntf.class);
    Hashtable itmap=new Hashtable();
    itmap.put(OIMConstants.ITRESOURCE_NAME, resourceName);
    tcResultSet rset=itIntf.findITResourceInstances(itmap);
    However, if I use the same code by getting the instance of ITResourceInstanceOperations, I am able to read the parameters ?? Any idea on this ??
    Thanks,
    Hrushikesh

    Project folder is a IDE concept, not used by Java itself. Java works with class paths, which designate where it can search for classes and resources.
    Anyway, most of the IDEs handle properties files correctly (i.e. copy them in the right place when building/compiling, so that they can be found by Java when running the program). So you should put them along with java classes, in your packages structure.
    So if you have a properties file named "Toto.properties", which is located in the "titi.tata" package, then you would load it with:ResourceBundle.getBundle("titi.tata.Toto");

  • Iomega ZIP drive-constantly unable to read disks when using on both PC&Mac

    I'm constantly having problems with Iomega ZIP disks:
    -can't be read by PC or MAC
    -needs reformatting
    I have to erase the disk using disk utitlities and make sure its FAT 32 (not 16) for the PC to read it.
    However this is only temporary as the disk will again become unreadable by both machines.
    Is this because i'm constantly using is on both machines?
    Does anyone else have this problem?
    Any solutions?
    This appears to have started since the last major OS X upgrade - i.e 10.3 to 10.4.
    Cheers
    Tasha

    You may not want to hear this - but the best thing to do is to get anything that matters off Zip disks, and never touch them again. They're inherently unreliable, and you're much better off using CD-R or DVD-R.

  • JHAT unable to read heap dump

    I have a heap dump taken on a 64 bit linux 1.5.0_16 JVM (64bit).
    I'm unable to read the file using JHAT (latest 1.6.0 JDK), getting the following error: WARNING: Ignoring unrecognized record type 32
    Have tried on both Win32 and 64bit Linux platforms.
    Regards,

    Hi Mike,
    your heap dump is probably broken. Taking heap dump with jmap under JDK 1.5 is more suited for recovering a heap dump from a core dump file rather than taking the heap dump of a running java application. jmap can observe the heap in an inconsistent state and hence the dump file is not always useful. You can try to create core dump of the java application (if you can) and than use jmap to get heap dump from core dump. Note that there is no such from when you are running on JDK/JRE 6.
    Bye,
    Tomas Hurka <mailto:[email protected]>
    NetBeans Profiler http://profiler.netbeans.org
    VisualVM http://visualvm.dev.java.net
    Software Engineer, Developer Platforms Group
    Sun Microsystems, Praha Czech Republic

  • I have problems when using the camera on my iPhone 4S (the same for my daughter with a iPhone4) A veil around the blurred photo, a development impossible and completely unable to read the bar code or QR code. What to do?

    I have problems when using the camera on my iPhone 4S (the same for my daughter with a iPhone4)
    A veil around the blurred photo, a development impossible and completely unable to read the bar code or QR code. What to do?

    Sounds kind of stupid, but check to make sure that your iphone case cover is not blocking the edge of the camera lens.  I had a silicone case on my 3S and when it got older, it started tot slip and the edges of my pictures were blurred.

  • Unable to read attachment from javamail using IMAP

    I am unable to read and save attachement in java mail using IMAP, but able to do using POP3
    Sample code below:
    Multipart multipart = (Multipart) message.getContent();
                             for (int i = 0, n = multipart.getCount(); i < n; i++)
                                  Part part = multipart.getBodyPart(i);
                                  String disposition = part.getDisposition();
              // here i am getting dispostion null if use IMAP, if  i use POP3 then i can able to recevive attachment                                                  
                                  if ((disposition != null) && ((disposition.equals(Part.ATTACHMENT) || (disposition.equals(Part.INLINE)))))
                                       System.out.println("file name is " + part.getFileName());
                                       message.setFlag(Flags.Flag.ANSWERED, true);
                                       saveFile(part.getFileName(), part.getInputStream());
    public static void saveFile(String fn, InputStream in) {
              try {
                   FileOutputStream fos = new FileOutputStream(new File("c://test//" + fn));
                   byte[] buf = new byte[1024];
                   int i = 0;
                   while ((i = in.read(buf)) != -1) {
                        fos.write(buf, 0, i);
                   in.close();
                   fos.close();
              } catch (IOException e) {
                   e.printStackTrace();
    Any help is appreciated
    Thanks
    Sami

    If you're getting disposition == null it's because your IMAP server
    isn't returning this information to you. Possibly your IMAP server
    is buggy. You can look at the protocol trace to see what the IMAP
    server is returning, and if it's missing information that should be there,
    report a bug to your IMAP server vendor.
    Your program might need to work around this problem by deciding
    that any body part with a filename is an attachment, or any part
    after the first is an attachment.

  • Unable to read data from Analog Devices 6b11 module - error code 1240

    Hi everyone,
    I'm trying to read data from a thermocouple with an AD 6B11 module in an AD 6BP16-1 backplane using RS232 serial. I've been following this guide:
    http://digital.ni.com/public.nsf/allkb/8C77E5E52B4A27968625611600559421
    Everything seems to work out well until step 13, where I call the "AD6B Input Module - Read Data.VI". I get an error code 1240 stating something like "invalid parameter or unable to read instrument".
    Has anyone got any experience with this error or suggestions to fixing it?
    Thanks in advance!

    That user guide is 20+ years old. The serial functions from that day used 0 for com 1, 1 for com 2, etc. Make sure you have the correct one selected. Please provide the exact error message instead of 'something like'.

  • How to updgrade to lion os 10.7 from leopard 10.6.8 using mac app store? unable to load redemption code to trigger upgrade

    how to updgrade to lion os 10.7 from leopard 10.6.8 using mac app store? unable to load redemption code to trigger upgrade.

    Apple Store Customer Service at 1-800-676-2775 or visit online Help for more information.
    To contact product and tech support: Contacting Apple for support and service - this includes
    international calling numbers..
    For Mac App Store: Apple - Support - Mac App Store.
    For iTunes: Apple - Support - iTunes.

  • I am unable to open encrypted emails using webmail and a CAC reader.  It says "content can't be displayed because the S/MIME control isn't available."  I'm using a Macbook Pro with 10.10 OS and have tried both Safari and Chrome.

    I am using a Macbook Pro with OS X Yosemite 10.10.2.  I am unable to open encrypted emails using webmail.  I have verified my certificates are loaded in the keychain for my military common access card while using a CAC reader.  When I try to view the message it gives me the error saying "content can't be displayed because the S/MIME control isn't available." 

    I am using a Macbook Pro with OS X Yosemite 10.10.2.  I am unable to open encrypted emails using webmail.  I have verified my certificates are loaded in the keychain for my military common access card while using a CAC reader.  When I try to view the message it gives me the error saying "content can't be displayed because the S/MIME control isn't available." 

Maybe you are looking for