4 Replies Latest reply: Nov 10, 2011 6:28 PM by 899593 RSS

    count messages in all accounts

    899593
      Hi all,

      I have a puzzle that I need to solve. In short, I've been asked to report the total number of emails in ALL users' accounts (minus emails sitting in trash). It looks like the JavaMail API only allows you to connect to one account at a time, and ONLY if you know the password (using store.connect).
      Is that the only way? Is there no way to solve this problem?

      Please help!

      TIA,
      Lucille
        • 1. Re: count messages in all accounts
          DrClap
          I wouldn't expect to be able to use JavaMail to read somebody else's e-mail without knowing their password. You didn't really expect that, did you?

          Although perhaps there's a super-user password which could be used for all accounts?
          • 2. Re: count messages in all accounts
            899593
            I'm not asking to read; I'm only asking for a count. That's why I was hoping somebody knows of another way.

            Look at it like this -- you can do: folder.getMessageCount(). Right? So is there a way to do System.AllFolders.getMessageCount()? I'm simplifying it, but that's essentially what I want.

            Anybody got a similar story of a request they've been given? Sys admins? Anybody?

            Thank you.
            • 3. Re: count messages in all accounts
              796440
              896590 wrote:
              I'm not asking to read; I'm only asking for a count.
              That still requires access to that account though.
              Look at it like this -- you can do: folder.getMessageCount(). Right?
              Can you do it without that account's password? If so, your problem is solved. If not, it's because that is a private part of that account that nobody but the account owner has a right to.
              • 4. Re: count messages in all accounts
                899593
                OK good. Thanks everyone. Appreciate the feedback.