OWA; Query number of messages in inbox

Hello all,
Is there a way, from Java, to ask the Exchange server how many messages are in a users' inbox and how many of them are new?
We want to write a simple text display iView that shows only the text 'Inbox #(<b></b>)', where '#' is number of messages in a users' inbox and '<b></b>' is the number of new messages there.
Any help is, of course, greatly appreciated.
Patrick.

Hello Patrick,
try following
import javax.mail.Session;
import javax.mail.Store;
final Session session = Session.getDefaultInstance(fMailServerConfig);//can be empty
final Store store = session.getStore("imap");
store.connect("EXCHANGE_SERVER", "YOUR_NT_DOMAIN\NT_ACCOUNT\EXCHANGE_ACCOUNT", "PASSWORD");
System.out.println(store.getFolder("Inbox").getMessageCount());
Best regards, Maksim Rashchynski.

Similar Messages

  • Is it possible to limit number of messages in Inbox?

    Hello all,
    I was wondering if there is any way to limit the number of messages that show in your Mail inbox. Similar to how the iPhone limits it to 200...
    Thanks in advance,
    -Chris

    You could set up a smart mailbox to only show 200 of the messages in your inbox, with priority given to those most recently received...

  • Displaying total number of messages in Inbox

    Using Mail in OS 10.3.9, the total number of messages in any selected mailbox was displayed just below the toolbar. This was very useful - when it got to around 800 I would know the time had come to archive some!
    However, in Leopard (10.5.2) there doesn't seem to be any way to simply display just this total number.
    Does anyone know of a way to display just the total?
    Thanks!

    Of course it does! Gosh, I'm stupid!
    Just goes to show that when you have looked at something for so long you take its location for granted!
    Thanks for helping!!

  • MRP - want to create query for Exception message number (MD04)

    Dear all MM kings
    consider  i had one purchase against xxxx material , if i go to MD04  In Exception message number  column i got massage number 20 Cancel process, now i want to know how many purchase order exist  in system having the Exception message number  20
    i want to define query for Exception message number 20
    is there any way to do the same

    Hi,
    There are links on the first thread on this MM board that describe how to produce a query.
    But if you have not done this before and have no ABAP experience, you might find it a bit tricky.
    You need someone to find the tabkle that stores the MRP lists and see if this contains the exception message, first.
    the structure I gave you is probably built dynamically by the program and so may not be available for a query.
    One simpler option is to use the "Collective access" tab in MD04. here you can enter an MRP controller etc. and get a list of materials. You can then find out which of the 8 numbered columns contains the exception message 20 and then sort the list in this sequence (the exception messages are linked to one of the columns and this can be different in every implementation and so I can't tell you which one it is)
    This will not just get the "20" messages unless they have been configured to use a separate column, but at least it is avail;able now without config and may be enough for your purposes.
    Steve B

  • Number of messages in the inbox is not displayed

    I have noticed that every once in a while, the number of messages header for my Inbox (and other folders) goes missing. If I quit and re-open Mail, it comes back. Attached is a screen shot showing the problem.

    I get the same with my N70. It only applies to the initial text, though. If you receive further texts from that contact, the contact name should be displayed. At least that's how it works for me.
    It makes sense to me... if the number wasn't in the contacts list when it was received, it would come through as a number. If you then add the contact, it won't change that text message, but it will change future ones.

  • How do you increase the number of messages retained in your inbox?

    How do you increase the number of messages retained in the inbox?

    settings - mail - email account - mail days to sync - choose the desired option.

  • TS3899 My mail is configured correctly.  When I go to view my inbox I get the 'Load More Messages...' with the number of messages showing.  I touch the display and nothing happens.  I have uninstalled and reinstalled the email account and restarted the de

    My mail is configured correctly.  When I go to view my inbox I get the 'Load More Messages...' with the number of messages showing.  I touch the display and nothing happens.  I have uninstalled and reinstalled the email account and restarted the device.  I can send mail fine as well as view my sent messages.  Very confusing.

    I have two yahoo accounts and I know as they 'improved' their servers I had periodic outages. It'd work fine on my webmail on  my computer, webmail on the iPad, but not via the mail app. And it was stuff on their end. It may be a case of wait and see and you may need to eventually remove/readd the account on your iPhone.
    When the issue is on their end, unfortunately there's not much for users to do beyond wait it out or find work arounds.

  • Yosemite mail v8.0 not showing how many messages are in a mailbox. For example inbox. Before upgrading it used to show how many messages you had in your inbox. anyone know how to switch "on" the number of messages?

    Yosemite mail v8.0 not showing how many messages are in a mailbox. For example inbox. Before upgrading it used to show how many messages you had in your inbox. anyone know how to switch "on" the number of messages? Or has this feature been removed?

    Agreed! This feature was very useful. If you find out how to turn it on, please let me know.
    Apple, there is plenty of room in the window header all the way across on both sides of the word "Inbox". It's important to know many messages are in the Inbox. It provides a progress meter when you're cleaning out mail and striving for inbox zero.

  • How to get the number of messages consumed by a MDB ??

    Hi all,
    How to get the number of messages consumed by a MDB displayed in OEM in a Java Application ???
    DMS ??? what use DMS ???
    tanks

    ok.
    Well using DMS is one way to get at these sorts of stats in a programmatic manner.
    There's a Java API you can use, or you could call out to the Spy servlet to query the DMS stats in either text or XML form.
    I don't have an MDB published so I can't show you specifiically, but here's the sort of query you can use to extract the data.
    http://localhost:8888/dms0/Spy?format=raw&table=oc4j_ejb_stateless_bean&recurse=children
    Which produces a table of the TEXT form:
    <DMSDUMP version='9.0.4' timestamp='1163456821185 (Tue Nov 14 08:57:01 CST 2006)' id='8888' name='OC4J'>
    <statistics>
    /oc4j [type=n/a]
    /oc4j/default [type=oc4j_ear]
    /oc4j/default/EJBs [type=oc4j_ejb]
    /oc4j/default/EJBs/jmsrouter_ejb [type=oc4j_ejb_pkg]
    /oc4j/default/EJBs/jmsrouter_ejb/AdminMgrBean [type=oc4j_ejb_stateless_bean]
    pooled.count:     11     ops
    pooled.maxValue:     1     count
    pooled.minValue:     0     count
    pooled.value:     0     count
    ready.count:     11     ops
    ready.maxValue:     1     count
    ready.minValue:     0     count
    ready.value:     0     count
    session-type.value:     Stateless     
    transaction-type.value:     Bean     
    /oc4j/default/EJBs/jmsrouter_ejb/EnqueuerBean [type=oc4j_ejb_stateless_bean]
    pooled.count:     11     ops
    pooled.maxValue:     0     count
    pooled.minValue:     0     count
    pooled.value:     0     count
    ready.count:     11     ops
    ready.maxValue:     0     count
    ready.minValue:     0     count
    ready.value:     0     count
    session-type.value:     Stateless     
    transaction-type.value:     Bean     
    /oc4j/default/EJBs/jmsrouter_ejb/TimerHandlerBean [type=oc4j_ejb_stateless_bean]
    pooled.count:     11     ops
    pooled.maxValue:     0     count
    pooled.minValue:     0     count
    pooled.value:     0     count
    ready.count:     11     ops
    ready.maxValue:     0     count
    ready.minValue:     0     count
    ready.value:     0     count
    session-type.value:     Stateless     
    transaction-type.value:     Bean     
    </statistics>
    </DMSDUMP>
    Or produces an XML document of the form:
    http://localhost:8888/dms0/Spy?format=xml&table=oc4j_ejb_stateless_bean&recurse=children
    You can use the Spy console to find the table that contains the details for MDB and then take it from there.
    This is not what you specifically want to do, but it does provide a good overview of how DMS is used.
    http://www.oracle.com/technology/pub/notes/technote_dms.html
    -steve-

  • Lost Email Messages in Inbox

    I've recently purchased a new PowerBook to replace my older Powerbook, and recently used the Migration tool to move all my files, settings, applications etc across to the new machine.
    Mail 2, upon starting for the first time does it usual conversion of stuff and correctly notes the 28174 messages. However when it say you can start using Mail, it only displays the most recent mail messages for the last seven days (273 messages). Which is not the 10198 messages I have on my old Powerbook in my Inbox (this about the last six years of mail). And I do archive mail regularly into other folders.
    I've tried rebuilding the mailbox, checking permssions - the mbox file size it identical to my old machine (518Mb). I've subsequently quit Mail, removed all the folders under ~/Library/Mail, restarted my old Powerbook in firewire mode and tied doing an import through Mail 2 with exactly the same result.
    I note a few other people have posted similar experiences with Mail 2. Given this is my first experience with Tiger (10.4.5), until I see this being resolved
    I'll use my old Powerbook (10.3.9). Thus far not impressed at all.
    PowerBook G4   Mac OS X (10.4.5)  
    PowerBook G4   Mac OS X (10.4.5)  

    I ended up going back and completely reinstalling the new PowerBook from scratch in case something was up and tried migrating again - same situation.
    Next I removed all the files/folders under the /Users/~/Library/Mail directory (ie blank slate)
    Having read similar posting from people, I then broke up my Inbox into folders by year received on the old Powerbook and then rebuild each of the mail folders. This had the Inbox down to 701 messages, with each of the folders holding between 396 to 1783 messages each. Restarted my old Powerbook
    in firewire mode and then performed a Import Mailboxes. Once the import was
    done, the old messages broken into various folders looked ok (ie number of messages matched), however the Inbox showed only 243 messages not the 701 messages originally there. In fact it appeared that only messages received in March were displayed and nothing else. I tried performing a Rebuild of the mailbox and all the messages (all 243) disappered. Searching
    failed, as did any further Rebuilds.
    So again I cleaned out the Mail directory on the new Powerbook, ejected firewire Powerbook drive and restarted the old Powerbook as normal. On
    the old Powerbook, I then created another folder and moved all 701 messages in the Inbox to the newly created folder, thus the Inbox was empty. Restarted the old Powerbook in firewire mode and repeated the Import Mailbox process.
    The seemed to go ok, all the messages were there, however I could not move the messages back to the Inbox from the folder. Given the previous experience with rebuilding a mailbox, I tried Rebuilding any of the folders partly to see if the same thing would re-occur - which it did, any mailbox selected and then a Rebuild performed would appear to delete all messages within the folder.
    If I look at any of the folders directory using Terminal, I see the following:
    -rw------- 1 evans evans 136022756 Apr 1 16:10 Incoming_Mail
    -rw-r--r-- 1 evans evans 541600 Apr 1 16:10 IncomingTable_ofContents
    -rw-r--r-- 1 evans evans 356 Apr 1 22:30 Info.plist
    drwx------ 1784 evans evans 60656 Apr 1 23:00 Messages
    The Incoming_Mail file is basically a mbox file (comparing it to 10.3's Mail),
    IncomingTable_ofContents, is a concatenation of Subject (with additional formatting). Info.plist is a file containing display information for the folder itself and finally Messages is a folder containing the Mail 2 of the individual messages.
    Out of curiosity I wondered if the TableofContents file was somehow being corrupted, so I removed the file and then went to look at the folder - oddly enough I could now view all the messages, whereas before after doing a Rebuild they completely vanished.
    In other folders I found the Messages folder has a name of Messages-T0x4c5c70-fTrRll, removing IncomingTable_ofContents in this instance made no difference, nor did removing the Messages-T0.. folder and renaming the Incoming_Messages to mbox and trying a Rebuild again.
    I've subsequently cleaned out the Mail folder on the new Powerbook and again perfomed a Import Mailboxes.
    From observations there appears to definitely be a problem when importing mail from 10.3.x as well as performing a mailbox rebuild, though I've yet to
    determine the cause of the failures.
    So looks like its back to the old Powerbook and reliable 10.3.9.

  • Mail 4.1, Exchange, and Duplicate messages in inbox

    Using Snow Leopard and Mail 4.1 to access an exchange account and a gmail account. The problem ONLY occurs in the Exchange account. My messages are all duplicating. Only in Mail are they duplicating. I've checked Outlook Web Access and Outlook on my windows machine - no duplicates there. Didn't start out this way, and the problem came once before, stopped, and now it has returned. If I delete one copy of the message, both messages get deleted. Is there someway to rebuild the mail inbox? or resync?
    Also, tried creating a new folder on the exchange server, copying all messages from inbox to the new folder, then moving back. In the temp/new folder, the messages were single. After copying back to Inbox - they doubled again. And again, only in Mail. The msgs remain single in Outlook, OWA, iPhone, Blackberry.
    UPDATE: I highlighted the exchange mailbox and went to MAILBOX > REBUILD. Erased everything but only in Mail. The messages are still on the Exchange server and can be seen by OWA, Outlook, iphone and blackberry. New messages are going to the Mail Exchange inbox but old messages are gone. Any way to get them back?
    Message was edited by: Atlantax

    FromBone wrote:
    Thanks V.K.! So there is no chance for me to re upload all the messages from my mac to my yahoo inbox.
    nope.
    May I ask yahoo to that?
    you can ask but they won't say anything different.
    I could never have known that the default setting on mac's mail would be "remove copy from server after retrieving a message".
    now, that's a valid point. this is not exactly advertised and mail setup assistant does not tell you anything about it. you can voice your concern to apple about this issue here
    http://www.apple.com/feedback/macosx.html
    I wish apple had some kind of a solution for this.
    there isn't anything you can do now. it's not up to apple at this point. you just can't upload messages to a POP email server. it does not matter what email client or what operating system you are using.
    Thanks again

  • Can i limit the number of messages saved on N97???

    hello everyone.
    i wanted to ask if there is a way to limit the amount of messages (SMS's) that the N97 saves.
    i noticed that in the out-going SMS folder i never have more than 20 messages (i cant remember if this was default or if i set it up this way). however my SMS inbox has no limit, right now for example i have 77 msg's in there.
    i would like to limit my inbox also to X messages.
    is there anyway to do that?
    thx

    Hi, all you have to do is go into messaging-options-other-set number of messages(and while you're there set memory in use to E)
    Good Luck, and Kudos is always appreciated 
    If I have helped at all, a click on the White Star is always appreciated :
    you can also help others by marking 'accept as solution' 

  • Count the number of message in remote queue.

    Does any method in MQSeries or JMS, can count the number of message in remote queue.
    I try to use QueueBrowser to browser, but got exception when browse the remote queue.
    thanks.

    You cannot read from, browse or query a remote MQ Queue, only write to it. Try www.mqseries.net or ibm website for any ways around this...

  • Is there is any licensing issue on number of message in/our from PI

    Hi Experts,
    There is one query from our client.
    Is there any license implications on number of messages that PI receives or sends out.
    Appreciate your help on this.
    Thanks,
    Shriram.

    Hi,
    tehre are two types of licences:
    1. volume based
    2. CPU based
    if he has the second one then there are no issues... if the first one he has to pay depending on the message volume 
    Regards,
    Michal Krawczyk

  • Number of messages notification in Mail disappears

    At the top of Mail, it lists the number of messages and new messages in the Inbox. For example:
    Inbox (67 messages, 2 unread)
    This always shows when I open Mail, but the counts randomly vanish. To get the counts back, I have to Quit and reopen Mail. This started when I upgraded to Yosemite.

    Try rebuilding the mailbox. This can take awhile if you have a lot of mail.
    Rebuild mailbox
    If that doesn't work, try re-indexing the mailboxes. This can take awhile if you have a lot of mail.
    Reindex messages      Mavericks/Yosemite

Maybe you are looking for

  • Field Cost Ctr is a required field for G/L account 5500

    Hello Experts, I need your help for one of the issue related to the cost center. While posting the accounting document I am getting the below error - Invocie Nr are: 95867831 and 95876503 Message is: Field Cost Ctr is a required field for G/L account

  • Apple customer service

    so I've had some issues with my battery, sometimes it was only 2 hours usage and i was having to recharge, took into the apple store today. told the genius about my problem, 2 minutes later i have a brand new iphone in my hand!!!!!!!! you wouldn't ge

  • How do i make all my imessages go into one conversation?

    My imessages between me and another contact used to all go into a single conversation on my iphone regardless of whether it was sent to their apple id email or their phone number, recently though that changed and now imessages with this contact's pho

  • Are i-photo books stored to be reordered??

    I backed up all my pictures from iphoto to a hard drive and deleted the originals(the whole entire iphoto library).now the hard drive is lost.i regulary made photobooks on iphoto.are they stored somewhere to be re-ordered?this might be my last chance

  • Form with Tab Canvas

    Hi, I've a form with 12 blocks. We are displaying the these twelve blocks in the tab canvases(Tab attachment Edge: Top). The problem with these tab canvas is user can see only the names of 4 tab canvases. Then he need to navigate using the scrollbar.