{"action":"created","issue":{"url":"https://api.github.com/repos/ecederstrand/exchangelib/issues/396","repository_url":"https://api.github.com/repos/ecederstrand/exchangelib","labels_url":"https://api.github.com/repos/ecederstrand/exchangelib/issues/396/labels{/name}","comments_url":"https://api.github.com/repos/ecederstrand/exchangelib/issues/396/comments","events_url":"https://api.github.com/repos/ecederstrand/exchangelib/issues/396/events","html_url":"https://github.com/ecederstrand/exchangelib/issues/396","id":318435790,"node_id":"MDU6SXNzdWUzMTg0MzU3OTA=","number":396,"title":"Accessing public folders","user":{"login":"michaelmontagne","id":22603517,"node_id":"MDQ6VXNlcjIyNjAzNTE3","avatar_url":"https://avatars0.githubusercontent.com/u/22603517?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelmontagne","html_url":"https://github.com/michaelmontagne","followers_url":"https://api.github.com/users/michaelmontagne/followers","following_url":"https://api.github.com/users/michaelmontagne/following{/other_user}","gists_url":"https://api.github.com/users/michaelmontagne/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelmontagne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelmontagne/subscriptions","organizations_url":"https://api.github.com/users/michaelmontagne/orgs","repos_url":"https://api.github.com/users/michaelmontagne/repos","events_url":"https://api.github.com/users/michaelmontagne/events{/privacy}","received_events_url":"https://api.github.com/users/michaelmontagne/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":26,"created_at":"2018-04-27T14:41:38Z","updated_at":"2018-09-25T16:34:08Z","closed_at":null,"author_association":"NONE","body":"I've heard that I can get to Public Folders using your library but I'm having a terrible time.  Except for that, the code you have developed is exactly what i needing right now.  I can get the object but there is nothing in it (total_count=0 and walk is empty.  There must be something simple that I am missing.\r\nIn Outlook I can see what I am searching for but in OWA I cannot.  I do not believe that public folders are shown in OWA though.\r\n\r\n```python\r\ncredentials = Credentials('user', 'pw')\r\nconfig = Configuration(server='outlook.office365.com', credentials=credentials)\r\naccount = Account(primary_smtp_address='user', config=config,\r\n                  autodiscover=False, access_type=DELEGATE)\r\nprint (dir(account.public_folders_root))\r\nprint (account.public_folders_root.total_count)\r\nprint (account.public_folders_root.walk())\r\n```"},"comment":{"url":"https://api.github.com/repos/ecederstrand/exchangelib/issues/comments/424414124","html_url":"https://github.com/ecederstrand/exchangelib/issues/396#issuecomment-424414124","issue_url":"https://api.github.com/repos/ecederstrand/exchangelib/issues/396","id":424414124,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDQxNDEyNA==","user":{"login":"michaelmontagne","id":22603517,"node_id":"MDQ6VXNlcjIyNjAzNTE3","avatar_url":"https://avatars0.githubusercontent.com/u/22603517?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelmontagne","html_url":"https://github.com/michaelmontagne","followers_url":"https://api.github.com/users/michaelmontagne/followers","following_url":"https://api.github.com/users/michaelmontagne/following{/other_user}","gists_url":"https://api.github.com/users/michaelmontagne/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelmontagne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelmontagne/subscriptions","organizations_url":"https://api.github.com/users/michaelmontagne/orgs","repos_url":"https://api.github.com/users/michaelmontagne/repos","events_url":"https://api.github.com/users/michaelmontagne/events{/privacy}","received_events_url":"https://api.github.com/users/michaelmontagne/received_events","type":"User","site_admin":false},"created_at":"2018-09-25T16:34:08Z","updated_at":"2018-09-25T16:34:08Z","author_association":"NONE","body":"With one small adjustment:\n\ncoll = FolderCollection(account=account, folders=[account.public_folders_root / 'Project'])\n\n\nThe top one works and the lower one fails:\n\nTraceback (most recent call last):\n\n  File \"testo365.py\", line 29, in <module>\n\n    for f in coll.find_folders(depth=\"Deep\"):\n\n  File \"/Users/michaelmontagne/.pyenv/versions/2.7.14/lib/python2.7/site-packages/exchangelib/services.py\", line 1012, in call\n\n    page_size=self.chunk_size,\n\n  File \"/Users/michaelmontagne/.pyenv/versions/2.7.14/lib/python2.7/site-packages/exchangelib/services.py\", line 374, in _paged_call\n\n    parsed_pages = [self._get_page(message) for message in response]\n\n  File \"/Users/michaelmontagne/.pyenv/versions/2.7.14/lib/python2.7/site-packages/exchangelib/services.py\", line 419, in _get_page\n\n    rootfolder = self._get_element_container(message=message, name='{%s}RootFolder' % MNS)\n\n  File \"/Users/michaelmontagne/.pyenv/versions/2.7.14/lib/python2.7/site-packages/exchangelib/services.py\", line 287, in _get_element_container\n\n    raise self._get_exception(code=response_code, text=msg_text, msg_xml=msg_xml)\n\nexchangelib.errors.ErrorInvalidOperation: Deep traversal queries are not allowed on public folders.\n\n\nMike Montagne | IT Director, associate | opsis architecture LLP | o:503.525.9511 d:503.943.6229 | www.opsisarch.com<http://www.opsisarch.com>\n\n________________________________\nFrom: Erik Cederstrand <notifications@github.com>\nSent: Tuesday, September 25, 2018 12:38:01 AM\nTo: ecederstrand/exchangelib\nCc: Mike Montagne; Mention\nSubject: Re: [ecederstrand/exchangelib] Accessing public folders (#396)\n\n\nHi @michaelmontagne<https://github.com/michaelmontagne>\n\nI'm curious whether deep folder traversal is only forbidden on the root public folder, or on all subfolders. Can you run this for me?:\n\ncoll = FolderCollection(account=account, folders=[account.public_root / 'Project'])\n\n# Should work\nfor f in coll.find_folders(depth=\"Shallow\"):\n    print(f.name)\n\n# Will maybe fail\nfor f in coll.find_folders(depth=\"Deep\"):\n    print(f.name)\n\n—\nYou are receiving this because you were mentioned.\nReply to this email directly, view it on GitHub<https://github.com/ecederstrand/exchangelib/issues/396#issuecomment-424238764>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AVjm_d-0voeQqRExmLodDphj7KbEvELiks5ued1ZgaJpZM4Tqfuc>.\n"}}
{"actor":{"display_login":"michaelmontagne"}}