9 Replies Latest reply: Nov 18, 2011 1:03 PM by Bill Shannon-Oracle RSS

    trouble reading/accessing a shared mailbox (via imap)

    897066
      I am having troubles accessing/reading a shared mailbox using IMAP.

      I have no problems accessing my own mailbox, but my account has a shared mailbox that I want to parse through, using javamail, in order to perform activities based on what emails arrive.

      Am I attempting the impossible?
        • 1. Re: trouble reading/accessing a shared mailbox (via imap)
          Bill Shannon-Oracle
          Yes, I think you are. You're attempting to get help without providing any of the information
          that would be necessary for someone to help you.

          What server are you using?

          How are you accessing the shared mailbox?

          How does it fail? What does the protocol trace show?
          • 2. Re: trouble reading/accessing a shared mailbox (via imap)
            897066
            Yes, I think you are. You're attempting to get help without providing any of the information that would be necessary for someone to help you.
            Understood. (and agreed)
            What server are you using?
            MS Exchange 2007
            How are you accessing the shared mailbox?
            I don't know how to access it, that's kinda the question. When I open ms outlook I see my own private mailbox with folders (that I can access via javamail no problems) and I also see a shared mailbox at the bottom of the list, lets call it Mailbox Otherstuff. This is the mailbox that I want my app to access and read.

            Here's a sample of some code that I've used to successfully access my own private mailbox...
            session = Session.getDefaultInstance(System.getProperties(), null);
            session.setDebug(true); 
            store = (IMAPStore) session.getStore("imap");
            store.connect(mailserver, username, password);
            Folder publicFolder = store.getFolder("/");
            Folder[] folders = publicFolder.list("*");
            How does it fail? What does the protocol trace show?
            There is no failure per-se, I just don't know what code I need to add/change/modify so that my app can access a shared mailbox instead of my own private mailbox (which is the default?)
            • 3. Re: trouble reading/accessing a shared mailbox (via imap)
              Bill Shannon-Oracle
              Sigh.

              You need an Exchange expert. Perhaps there's some Microsoft forum where they can help you?

              The issue is that you need to know the full IMAP name of the shared mailbox you want to access.
              There's an IMAP extension that would allow you to discover these names, but my understanding
              is that Exchange doesn't support it.

              Perhaps someone else on this forum has experience in this area?
              • 4. Re: trouble reading/accessing a shared mailbox (via imap)
                897066
                Ok, so let's say that I managed to find the fully qualified imap address. Let's say that it was "DOMAIN/USERNAME/MAILBOX" for example.

                What, in the code above, would have to change to utilise this example imap address & hypothetically connect to this fictitious mailbox?
                • 5. Re: trouble reading/accessing a shared mailbox (via imap)
                  Bill Shannon-Oracle
                  Folder publicFolder = store.getFolder("DOMAIN/USERNAME/MAILBOX");
                  • 6. Re: trouble reading/accessing a shared mailbox (via imap)
                    897066
                    Ok, I'll see if I can track someone down here (in the IT section of my company) who may have the information I need.
                    • 7. Re: trouble reading/accessing a shared mailbox (via imap)
                      Bill Shannon-Oracle
                      [url http://social.technet.microsoft.com/Forums/bg-BG/exchangesvrgeneral/thread/8c8b4605-efae-49eb-a118-54aa418de6c2]This article suggests that the way to access a shared mailbox is to authenticate using a
                      user name associated with the shared mailbox.

                      If that doesn't work for you, you may find more help in that forum.

                      If you figure it out, please report back here and I'll document it for other users.
                      • 8. Re: trouble reading/accessing a shared mailbox (via imap)
                        897066
                        I just wanted to let you know that I am now accessing a shared mailbox using javamail, and it's purring along nicely.

                        For anyone else that is attempting this, you must use the 'alias' name of the shared mailbox, your outlook admin can provide you with this. (Note: it usually does not contain any spaces, there are many outlook properties for a shared mailbox but it is the one microsoft labels as 'alias' that you need to use to connect via javamail)

                        You also need the password for the shared mailbox which as I found out, the admins may not know. For me, the password was stipulated by the group who first requested the creation of the shared mailbox (ie: before my time) so finding the actual people who know the password was a problem in itself.

                        Finally, thankyou for your help, bshannon. Much appreciated.
                        • 9. Re: trouble reading/accessing a shared mailbox (via imap)
                          Bill Shannon-Oracle
                          Thanks for confirming that this works. I've added this information to the [url http://kenai.com/projects/javamail/pages/Exchange]JavaMail wiki.