MAIL API : MessageCountListener not working

Dear friends
I'm having a problem with mail API. I added a messagecountlistener to my INBOX folder. But it is not responding to new mails. I tried using the monitor example that comes along with the samples in mail API but that too is not working.. Following is the code of monitor.java sample
public static void main(String argv[])
     if (argv.length != 5) {
     System.out.println("Usage: monitor <host> <user> <password> <mbox> <freq>");
     System.exit(1);
     System.out.println("\nTesting monitor\n");
try {
     Properties props = System.getProperties();
     // Get a Session object
     Session session = Session.getDefaultInstance(props, null);
     // session.setDebug(true);
     // Get a Store object
     Store store = session.getStore("imap");
     // Connect
     store.connect(argv[0], argv[1], argv[2]);
     // Open a Folder
     Folder folder = store.getFolder(argv[3]);
     if (folder == null || !folder.exists()) {
          System.out.println("Invalid folder");
          System.exit(1);
     folder.open(Folder.READ_WRITE);
     // Add messageCountListener to listen for new messages
     folder.addMessageCountListener(new MessageCountAdapter() {
          public void messagesAdded(MessageCountEvent ev) {
          Message[] msgs = ev.getMessages();
          System.out.println("Got " + msgs.length + " new messages");
          // Just dump out the new messages
          for (int i = 0; i < msgs.length; i++) {
               try {
               DataHandler dh = msgs.getDataHandler();
               InputStream is = dh.getInputStream();
               int c;
               while ((c = is.read()) != -1)
                    System.out.write(c);
               } catch (IOException ioex) {
               ioex.printStackTrace();     
               } catch (MessagingException mex) {
               mex.printStackTrace();
     // Check mail once in "freq" MILLIseconds
     int freq = Integer.parseInt(argv[4]);
     for (; ;) {
          Thread.sleep(freq); // sleep for freq milliseconds
          // This is to force the IMAP server to send us
          // EXISTS notifications.
          int i = folder.getMessageCount();
System.out.println(i);
     } catch (Exception ex) {
     ex.printStackTrace();
Problem is that inspite of new mails coming in , the count is not incrementing and no listener is getting activated.. Please give me a solution for this
Regards
DST
Can anyone tell me why

Hello!
I've the same problem, using protocol pop3 insteadof imap.
I use jdk1.4 and the last release of mail.jar and activation.jar.
Please help !
Thanx.
Fabien.

Similar Messages

  • When logging in into yahoo mail after typing in password Firefox is adding something, login fails all the time. At yahoo mail Notepad does not work because it is impossible to close the list of items and they cover information, so I have to go to IE.

    When logging in into yahoo mail after typing in password Firefox is adding something, probably remembered password and login fails all the time. At yahoo mail Notepad does not work because it is impossible to close the list of items and they cover information, so I have to go to IE.

    Only when i go to a different browser (like IE) after i clear it , then all that shows up is the pages i visited in IE , that is what bugs me , why is IE browsing history sowing up in Firefox ??
    Basically , i can clear the history in Firefox , and then for a example , go to Craigslist , using IE7 (launching it from a complete different Icon , in other words at that time i never open Firefox) , then after closing out , or even leaving open as it does not seem to matter , i go into Firefox , and hit History , and there is every place i visited in IE7 , on my History in Firefox

  • In Oats Drag and Drop Api is not working in Firefox Browser

    To Write OAts test for Drag and Drop functionality
    we are using "dragTo" API.
    Ex :
    web.image("/web:window[@index='0' or @title='Fusion Applications']/web:document[@index='0' or @name='aqizmnwha_1']/web:img[@absoluteLocator='" + sourceIndex + "']")
                     .dragTo("/web:window[@index='0' or @title='Fusion Applications']/web:document[@index='0' or @name='aqizmnwha_1']/web:img[@absoluteLocator='" + targetIndex + "']");
    This Api is not working in firfox.(works in IE browser).
    Is there any other way we can test DnD functionality in firefox and IE?
    Thanks in Advance!
    Thanks,
    Siddi

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you turn on the computer, and again when you log in.
    Note: If FileVault is enabled, or if a firmware password is set, or if the startup volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.
    The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, restart as usual (not in safe mode) and verify that you still have the problem. Post the results of the test.

  • Issue is TEXT_IO application API is not working in report builder 10g.

    Issue is TEXT_IO application API is not working in report builder 10g.
    TEXT_IO application api is working in report builder 6i. (Not working in upgrade from Oracle EBiz 11i to Oracle Ebiz R12)
    I saw that details in some forums, client_text_io is available for form builder 10g.
    Is any other api available for report builder 10g?
    If it is available what steps we need to do?

    All the CLIENT_% procedures are part of webutil in Forms. Forms uses the Java applet on the client PC to perform actions on the local PC via webutil. This is not possible for Reports.
    You can still use text_io on the server, but you need some other way to copy the files to/from the client PC.
    I wonder how you used the functionality in EBS R11. Even R11 uses web reports, so text_io already worked on the server, not the client PC.

  • After upgrading to iOS 5 I cannot enter to mail (outlook exchange ),contact did not open, general settings - mail contact did not work.help me

    After upgrading to iOS 5 I cannot enter to mail (outlook exchange ),contact did not open, general settings - mail contact did not work.help me

    Hi,
    the settings are gone, i guess. But even worse, I cannot get the iPad2 to play Full HD thru the Apple digital AV adaptor using apps that support  (and advertise this), like AVPlayer HD. This definiteley used to work before one of the last iOS upgrades. (I am now at 5.1.1).

  • My mail icon is not working after update ios 6.1.1 ????

    dear sir please give me soluction.
    my mail icon is not working after update of ios 6.1.1

    You can only purchase apps and other media for the county's sore in which yu are located. You account, included payment method, also must be associated with that country.
    Sam applies for updating apps. Note that not all apps are available in all country so y will not be able to update an app if you are in another country and that app is not available in that country or your account is not associated with that country.
    You can change the country and other things by:
    iOS: Changing the signed-in iTunes Store Apple ID account

  • Fetch new mail messages does not work

    On my notebook the fetch new mail messages does not work
    Settings:
    - Fetch new messages:     every minute
    - Play sound Purr
    I need to us the manual button.
    On my imac it works fine with the same accounts

    My mail sounds are all screwed up. I hear the plane fly when I send an email but when I receive mail, no sound. I have rules set up which worked in Tiger. One rule is for mail to play a message "You have a message from "John Doe" when I receive an email from "John Doe" but it only plays when I send "John Doe" and email. Assbackwards.
    Sometimes when reading new mail, it just disappears. I have to click on it again. I find this version of email to be very flaky!
    Dave Brenneman

  • E-mail notification does not work. PX12-400r

    E-mail notification does not work. Test message fails, like everyone else. Is that possible? Someone else had this problem?

     Hello gusev67
    Have you tried with/without custom email notification (SMTP) settings?  
    Have you checked if the defaut or custom SMTP port has been forwarded to your px12?
    Have you checked if your ISP is blocking SMTP ports for your connection?
    LenovoEMC Contact Information is region specific. Please select the correct link then access the Contact Us at the top right:
    US and Canada: https://lenovo-na-en.custhelp.com/
    Latin America and Mexico: https://lenovo-la-es.custhelp.com/
    EU: https://lenovo-eu-en.custhelp.com/
    India/Asia Pacific: https://lenovo-ap-en.custhelp.com/
    http://support.lenovoemc.com/

  • The Yahoo mail toolbar is not working. Can't delete, can't move, can't mark as read, etc. It works on Chrome. What's up?

    The Yahoo mail toolbar is not working. Can't delete, can't move, can't mark as read, etc. It works on Chrome. What's up?

    Of course they would say that. Tell us are there any other problems?
    Some added toolbar and anti-virus add-ons are known to cause
    Firefox issues. '''Disable All of them.'''
    Make sure you have the latest version. The best thing to do is first remove
    the program, then get the full installer.

  • Nokia browser & mail service is not working in my ...

    nokia browser & mail service is not working in my x2-02. When i select those 2 icons they didnt respond at all. Please help me.
    Solved!
    Go to Solution.

    hi mate,
    have you checked if there are any firmware updates available for your device? if there are any, please update to the latest version offered. if that fails, try reinstalling your current firmware thru Nokia Suite, and if that doesn't work, then Restore your phone to factory settings.
    Failign the above, you need to visit Nokia Care for inspection: http://nokia.com/support

  • 10.9.1 Mail spotlight search not working!!!!! APPLE HELP!!!!!!

    10.9.1 Mail spotlight search not working!!!!!

    When you type in a search term in Mail, does it drop down a list of search criteria like People, Subjects, Mailboxes?
    Or does it just offer "message contains"

  • My Comcast Mail account is not working on all three devices

    Good Morning!
    Last night I plugged in my IPhone and IPad for charging and syncing. This morning my Comcast mail account is not working on my MAC, IPad and IPhone.
    I have deleted the acount on all three devices and set up a "new" account. Did not work. One message I receive is check the mail servicer. I have made sure the correct info is entered. My GMail and Mac email are working.
    Please help

    Problem with Comcast since last night. They say it won't be solved til after 8 tonight.
    Thank you

  • My e mail notifier is not working althouth i have done a test with my server

    ''locking as a duplicate - https://support.mozilla.com/en-US/questions/834474''
    My e-mail notifier is not working. I have checked my e mail notifier settings and tested account which was ok.
    No e-mail notifications are showing but when i enter my windows live mail i do have emails in my inbox.

    I have already tried this but still the same. I have also tried un-pairing my speakers and re-pairing! Still get broken playback at times. This even happens when I am close to the bluetooth receiver.

  • Mail flow is not working Exchange 2010 to 2013 in coexistence mode

    Hi ,
    We are migrating Exchange 2010 sp3 to Exchange 2013.
    mail flow is not working from 2010 to 2013, mails are qued up in smtp relay queueu.
    already added 2010 ip  address  to 2013 receive connector and give anonymous permission.
    but still mails are smtp relay queue.

    Hi Sujith,
    As requested by
    Nithyanandham please post the error from Queue Viewer.
    Few things to check. 
    Please remove IP address from "Default Receive connector" first.
    Ensure both servers can ping by FQDN and it returns correct IP.  i.e.  ping exch2013.contoso.com
    Make sure both exchange server can communicate each other. if possible try to telnet port 25 by FQDN of the Exchange2013 server and try to send an email from exchange2010 using the URL below. if there is any error please post error.
    http://exchange.mvps.org/smtp_frames.htm
    Make sure "Exchange server Authentication" is ticked in your default receive connector properties. If not ticked tick it and restart Transport service and check mail flow again.
    Thanks, MAS
    Please mark as helpful if you find my comment helpful or as an answer if it does answer your question. That will encourage me - and others - to take time out to help you.

  • Mail application will not work with latest version mac 4.5

    mail application will not work with latest version mac 4.5

    You can get Firefox 3.6 from http://www.mozilla.com/en-US/firefox/all-older.html

Maybe you are looking for

  • In Mail, clicking on a date does not properly create an iCal event

    If I click on a time/date in an email, a miniature calendar pops up showing the event as best as Mail can parse it. There are also two buttons: Edit and Add to iCal. If I click on Edit, I get a chance to change some of the parameters of the event, an

  • I need help getting my printer to work

    I need help getting my printer to work

  • Can't Completely Uninstall an App That Doesn't Exist Anymore

    Alright, so I've got a very run-of-the-mill, mid-2011 Macbook Air (1.6 GHz Intel Core i5, 2 GB 1333 MHz DDR3, running Yosemite) and everything really does run just fine. The only issue I've been having is completely eliminating traces of a particular

  • Automatic Deletion of Files in FRA

    Ok, I am about fired up right now. I have read over and over how Oracle will reclaim space in the FRA if it is running low yet I can't reproduce this behavior to save my life. - I have archive logging enabled. - I am using the FRA. - I have a recover

  • Third screen for PBG4

    Is there any way I can add a second external screen to my PBG4? I currently have a 20-inch Flat Plane Array attached to the DVI port of my G4 PowerBook, giving me effectively two screens: the PB's own and the external. Can I attach a third? I have he