1
0
Fork 0

Office365 API mailbox support (#251)

* Update models.py, __init__.py, and office365.py

* Update setup.py

* Office365Transport properties

* Update .gitignore

* wrong folder stage

* Update models.py

* Update office365.py and models.py

* office365 implementation

* Update office365.py

* clear code

* fix import

* Update readme.rst

* archive and delete

* fix and documentation

* removed build folder

* missing archive

Co-authored-by: Pietro Mingo <p.mingo@intac.it>
Co-authored-by: Serafim Bordei <s.bordei@intac.it>
This commit is contained in:
Pietro Mingo 2023-01-16 22:23:38 +01:00 committed by GitHub
parent 40263b6670
commit cefbcdebd2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 129 additions and 3 deletions

View file

@ -13,6 +13,7 @@ POP3 and IMAP as well as local file-based mailboxes.
POP3 ``pop3://`` Can also specify SSL with ``pop3+ssl://``
IMAP ``imap://`` Can also specify SSL with ``imap+ssl://`` or STARTTLS with ``imap+tls``; additional configuration is also possible: see :ref:`pop3-and-imap-mailboxes` for details.
Gmail IMAP ``gmail+ssl://`` Uses OAuth authentication for Gmail's IMAP transport. See :ref:`gmail-oauth` for details.
Office365 API``office365://`` Uses OAuth authentication for Office365 API transport. See :ref:`office365-oauth` for details.
Maildir ``maildir://``
Mbox ``mbox://``
Babyl ``babyl://``
@ -115,6 +116,25 @@ Build your URI accordingly::
gmail+ssl://youremailaddress%40gmail.com:oauth2@imap.gmail.com?archive=Archived
.. _office365-oauth:
Office 365 API
-------------------------------------
Office 365 allows through the API to read a mailbox with Oauth.
The O365_ library is used.
.. _O365: https://github.com/O365/python-o365
.. _configuration: https://github.com/O365/python-o365#authentication
For the configuration_ you need to register an application and get a client_id, client_secret and tenant_id.
This implementation uses the client credentials grant flow and the password you specify will be ignored.
Build your URI accordingly::
office365://youremailaddress%40yourdomain.com:oauth2@outlook.office365.com?client_id=client_id&client_secret=client_secret&tenant_id=tenant_id&archive=Archived
Local File-based Mailboxes
--------------------------