2

I am trying to use exchangelib in order to monitor an e-mail address from a dedicated server without requiring an instance of Outlook be installed. We want to move the emails to a processed subfolder once completed. I have been able to connect to the shared mailbox and see the e-mails within the inbox. When I am trying to move the e-mail to the sub folder I am receiving the error. I used exchangelib to create the subfolder and can see it within outlook and OWA.

What am I doing incorrectly?

Here is the code that I am using:

def _move_to_processed(item):
    processed_folder = account.inbox / 'Processed_Test'
    item.move(processed_folder)

Error message:

raise ErrorFolderNotFound("No subfolder with name '%s'" % other)
exchangelib.errors.ErrorFolderNotFound: No subfolder with name 'Processed_Test'
colidyre
  • 4,170
  • 12
  • 37
  • 53
d_bergeron
  • 126
  • 3
  • Can you post the entire stack trace? I assume the exception is caused by line 2, but it's nice to be sure. Also, that line will only work if `a.root.tree()` contains a folder called `Processed_Test` at the location you specified. – Erik Cederstrand May 16 '18 at 10:57
  • File "C:\email.py", line 198, in mailbox_helper().scan_inbox() File "C:\email.py", line 99, in scan_inbox self.__move_to_processed(item) File "C:\email.py", line 70, in _move_to_processed processed_folder = self.account.inbox / 'Processed Folder' File "email.py", line 844, in __truediv__ raise ErrorFolderNotFound("No subfolder with name '%s'" % other) exchangelib.errors.ErrorFolderNotFound: No subfolder with name 'Processed Folder' – d_bergeron May 21 '18 at 13:51
  • @ErikCederstrand : The folder does not show during a.root.tree(). It is showing the folders within my account, not the shared account. Would there be another way to navigate to processed folder? – d_bergeron May 21 '18 at 13:58
  • Ah. I think that bug was fixed in https://github.com/ecederstrand/exchangelib/commit/71def9d94220eb639241b6a56a164cf4b7b9b593 which is not in any release yet. You could try installing from GitHub and see if that fixes it for you. – Erik Cederstrand May 21 '18 at 20:57
  • 1
    That fixed the issue! The process can find the Processed Folder within the Shared Mailbox, and move items to it. Thank you very much for your help! – d_bergeron May 22 '18 at 13:14

0 Answers0