Couple questions after successfully retrieving inbox. #815
Unanswered
joerocks97
asked this question in
Q&A
Replies: 1 comment
-
There are a lot of questions here... POP is not allowed here. We are just using MS Graph api. It moves messages using message.move. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
#!/usr/bin/python
from O365 import Account
credentials = ('id','secret')
the default protocol will be Microsoft Graph
account = Account(credentials, auth_flow_type='credentials', tenant_id='xx-xx')
if account.authenticate():
print('Authenticated!')
mailbox=account.mailbox(resource='[email protected]')
inbox = mailbox.inbox_folder()
for message in inbox.get_messages():
print(message)
Using the code above, was able to retrieve all e-mail from any account in the tenant.
I would like to use POP to download messages and not just the subject. The above code list all messages in inbox, but no body, and does not move, but just copies the messages.
Also, in Azure, how to control what mailboxes these App has access to view? It looks like it by default can view any mailbox in the tenant that is after granted permissions using application and not delegated.
Thanks for the Python module, it looks very promising since MS is phasing out the legacy protocols except for SMTH.
Beta Was this translation helpful? Give feedback.
All reactions