diff --git a/docs/exchangelib/autodiscover/index.html b/docs/exchangelib/autodiscover/index.html index e6e83246..03e865b6 100644 --- a/docs/exchangelib/autodiscover/index.html +++ b/docs/exchangelib/autodiscover/index.html @@ -45,10 +45,10 @@
exchangelib.autodiscover
exchangelib.configuration
exchangelib.configuration
var credentials
+class O365InteractiveConfiguration
+(client_id, username)
+
Contains information needed to create an authenticated connection to an EWS endpoint.
+The 'credentials' argument contains the credentials needed to authenticate with the server. Multiple credentials +implementations are available in 'exchangelib.credentials'.
+config = Configuration(credentials=Credentials('john@example.com', 'MY_SECRET'), …)
+The 'server' and 'service_endpoint' arguments are mutually exclusive. The former must contain only a domain name, +the latter a full URL:
+config = Configuration(server='example.com', ...)
+config = Configuration(service_endpoint='https://mail.example.com/EWS/Exchange.asmx', ...)
+
+If you know which authentication type the server uses, you add that as a hint in 'auth_type'. Likewise, you can +add the server version as a hint. This allows to skip the auth type and version guessing routines:
+config = Configuration(auth_type=NTLM, ...)
+config = Configuration(version=Version(build=Build(15, 1, 2, 3)), ...)
+
+You can use 'retry_policy' to define a custom retry policy for handling server connection failures:
+config = Configuration(retry_policy=FaultTolerance(max_wait=3600), ...)
+
+'max_connections' defines the max number of connections allowed for this server. This may be restricted by +policies on the Exchange server.
class O365InteractiveConfiguration(Configuration):
+ SERVER = "outlook.office365.com"
+
+ def __init__(self, client_id, username):
+ credentials = O365InteractiveCredentials(client_id=client_id, username=username)
+ super().__init__(server=self.SERVER, auth_type=OAUTH2, credentials=credentials)
+var SERVER
server
+O365InteractiveConfiguration
SERVER
exchangelib.credentials
+class O365InteractiveCredentials
+(client_id, username)
+
Login info for OAuth 2.0 authentication using the authorization code grant type. This can be used in one of +several ways: +* Given an authorization code, client ID, and client secret, fetch a token ourselves and refresh it as needed if +supplied with a refresh token. +* Given an existing access token, client ID, and client secret, use the access token until it expires and then +refresh it as needed. +* Given only an existing access token, use it until it expires. This can be used to let the calling application +refresh tokens itself by subclassing and implementing refresh().
+Unlike the base (client credentials) grant, authorization code credentials don't require a Microsoft tenant ID +because each access token (and the authorization code used to get the access token) is restricted to a single +tenant.
+:param authorization_code: Code obtained when authorizing the application to access an account. In combination +with client_id and client_secret, will be used to obtain an access token.
class O365InteractiveCredentials(OAuth2AuthorizationCodeCredentials):
+ AUTHORITY = "https://login.microsoftonline.com/organizations"
+ SCOPE = ["EWS.AccessAsUser.All"]
+
+ def __init__(self, client_id, username):
+ import msal
+
+ app = msal.PublicClientApplication(client_id=client_id, authority=self.AUTHORITY)
+ print("A local browser window will be open for you to sign in. CTRL+C to cancel.")
+ access_token = app.acquire_token_interactive(self.SCOPE, login_hint=username)
+ super().__init__(access_token=access_token)
+var AUTHORITY
var SCOPE
OAuth2AuthorizationCodeCredentials
:
+
+BaseOAuth2Credentials
:
+client
class OAuth2AuthorizationCodeCredentials
(authorization_code=None, **kwargs)
@@ -887,6 +970,10 @@ Ancestors
BaseOAuth2Credentials
BaseCredentials
+Subclasses
+
Inherited members
BaseOAuth2Credentials
:
@@ -1078,6 +1165,13 @@ O365InteractiveCredentials
+
+
+-
OAuth2AuthorizationCodeCredentials
-
diff --git a/docs/exchangelib/ewsdatetime.html b/docs/exchangelib/ewsdatetime.html
index af383698..403cfa61 100644
--- a/docs/exchangelib/ewsdatetime.html
+++ b/docs/exchangelib/ewsdatetime.html
@@ -719,7 +719,7 @@
Static methods
def fromisoformat(date_string)
string -> datetime from datetime.isoformat() output
string -> datetime from a string in most ISO 8601 formats
exchangelib.folders.base
exchangelib.folders.base
exchangelib.folders.base
exchangelib.folders
exchangelib.folders
exchangelib.folders
exchangelib.folders
exchangelib.folders
class AllCategorizedItems(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "allcategorizeditems"
- CONTAINER_CLASS = "IPF.Note"
+ CONTAINER_CLASS = "IPF.Note"
+ supported_from = EXCHANGE_O365
var supported_from
class AllTodoTasks(NonDeletableFolder):
- DISTINGUISHED_FOLDER_ID = None
CONTAINER_CLASS = "IPF.Task"
- supported_item_models = (Task,)
- LOCALIZED_NAMES = {
- None: ("AllTodoTasks",),
- }
+ supported_item_models = TASK_ITEM_CLASSES
var DISTINGUISHED_FOLDER_ID
var LOCALIZED_NAMES
var supported_item_models
+class CalendarSearchCache
+(**kwargs)
+
A mixin for non-wellknown folders than that are not deletable.
class CalendarSearchCache(NonDeletableFolder):
+ CONTAINER_CLASS = "IPF.Appointment"
+var CONTAINER_CLASS
NonDeletableFolder
:
+ID_ELEMENT_CLS
account
add_field
all
deregister
exclude
filter
folder_cls_from_container_class
folder_sync_state
get
get_distinguished
get_events
get_streaming_events
item_sync_state
none
parent
people
register
remove_field
root
subscribe_to_pull
subscribe_to_push
subscribe_to_streaming
supported_fields
sync_hierarchy
sync_items
test_access
tree
unsubscribe
validate_field
class CommonViews
(**kwargs)
@@ -3828,7 +3896,7 @@ Inherited members
class Companies(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "companycontacts"
CONTAINER_CLASS = "IPF.Contact.Company"
- supported_item_models = (Contact, DistributionList)
+ supported_item_models = CONTACT_ITEM_CLASSES
LOCALIZED_NAMES = {
"da_DK": ("Firmaer",),
}
@@ -3988,7 +4056,7 @@ Inherited members
class Contacts(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "contacts"
CONTAINER_CLASS = "IPF.Contact"
- supported_item_models = (Contact, DistributionList)
+ supported_item_models = CONTACT_ITEM_CLASSES
LOCALIZED_NAMES = {
"da_DK": ("Kontaktpersoner",),
"de_DE": ("Kontakte",),
@@ -4715,7 +4783,8 @@ Inherited members
class DlpPolicyEvaluation(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "dlppolicyevaluation"
- CONTAINER_CLASS = "IPF.StoreItem.DlpPolicyEvaluation"
+ CONTAINER_CLASS = "IPF.StoreItem.DlpPolicyEvaluation"
+ supported_from = EXCHANGE_O365
Ancestors
@@ -4738,6 +4807,10 @@ Class variables
-
+var supported_from
+-
+
+
Inherited members
@@ -4787,8 +4860,10 @@ Inherited members
Expand source code
-
class Drafts(Messages):
+class Drafts(WellknownFolder):
+ CONTAINER_CLASS = "IPF.Note"
DISTINGUISHED_FOLDER_ID = "drafts"
+ supported_item_models = MESSAGE_ITEM_CLASSES
LOCALIZED_NAMES = {
"da_DK": ("Kladder",),
"de_DE": ("Entwürfe",),
@@ -4803,7 +4878,6 @@ Inherited members
Ancestors
-- Messages
- WellknownFolder
- Folder
- BaseFolder
@@ -4815,6 +4889,10 @@ Ancestors
Class variables
+var CONTAINER_CLASS
+-
+
+
var DISTINGUISHED_FOLDER_ID
-
@@ -4823,41 +4901,45 @@
Class variables
-
+ var supported_item_models
+-
+
+
Inherited members
-Messages
:
+WellknownFolder
:
-ID_ELEMENT_CLS
-account
-add_field
-all
-deregister
-exclude
-filter
-folder_cls_from_container_class
-folder_sync_state
-get
-get_distinguished
-get_events
-get_streaming_events
-item_sync_state
-none
-parent
-people
-register
-remove_field
-root
-subscribe_to_pull
-subscribe_to_push
-subscribe_to_streaming
-supported_fields
-sync_hierarchy
-sync_items
-test_access
-tree
-unsubscribe
-validate_field
+ID_ELEMENT_CLS
+account
+add_field
+all
+deregister
+exclude
+filter
+folder_cls_from_container_class
+folder_sync_state
+get
+get_distinguished
+get_events
+get_streaming_events
+item_sync_state
+none
+parent
+people
+register
+remove_field
+root
+subscribe_to_pull
+subscribe_to_push
+subscribe_to_streaming
+supported_fields
+sync_hierarchy
+sync_items
+test_access
+tree
+unsubscribe
+validate_field
@@ -5003,12 +5085,8 @@ Inherited members
Expand source code
class ExternalContacts(NonDeletableFolder):
- DISTINGUISHED_FOLDER_ID = None
CONTAINER_CLASS = "IPF.Contact"
- supported_item_models = (Contact, DistributionList)
- LOCALIZED_NAMES = {
- None: ("ExternalContacts",),
- }
+ supported_item_models = CONTACT_ITEM_CLASSES
Ancestors
@@ -5027,14 +5105,6 @@ Class variables
-
-var DISTINGUISHED_FOLDER_ID
--
-
-
-var LOCALIZED_NAMES
--
-
-
var supported_item_models
-
@@ -5089,8 +5159,8 @@
Inherited members
Expand source code
class Favorites(WellknownFolder):
- CONTAINER_CLASS = "IPF.Note"
DISTINGUISHED_FOLDER_ID = "favorites"
+ CONTAINER_CLASS = "IPF.Note"
supported_from = EXCHANGE_2013
Ancestors
@@ -5370,6 +5440,10 @@ Inherited members
)
if folder_cls == Folder:
log.debug("Fallback to class Folder (folder_class %s, name %s)", folder.folder_class, folder.name)
+ # Some servers return folders in a FindFolder result that have a DistinguishedFolderId element that the same
+ # server cannot handle in a GetFolder request. Only set the DistinguishedFolderId field if we recognize the ID.
+ if folder._distinguished_id and not folder_cls.DISTINGUISHED_FOLDER_ID:
+ folder._distinguished_id = None
return folder_cls(root=root, **{f.name: getattr(folder, f.name) for f in folder.FIELDS})
Ancestors
@@ -5450,6 +5524,10 @@ Static methods
)
if folder_cls == Folder:
log.debug("Fallback to class Folder (folder_class %s, name %s)", folder.folder_class, folder.name)
+ # Some servers return folders in a FindFolder result that have a DistinguishedFolderId element that the same
+ # server cannot handle in a GetFolder request. Only set the DistinguishedFolderId field if we recognize the ID.
+ if folder._distinguished_id and not folder_cls.DISTINGUISHED_FOLDER_ID:
+ folder._distinguished_id = None
return folder_cls(root=root, **{f.name: getattr(folder, f.name) for f in folder.FIELDS})
@@ -7363,7 +7441,7 @@ class Friends(NonDeletableFolder):
CONTAINER_CLASS = "IPF.Note"
- supported_item_models = (Contact, DistributionList)
+ supported_item_models = CONTACT_ITEM_CLASSES
LOCALIZED_NAMES = {
"de_DE": ("Bekannte",),
}
@@ -7443,8 +7521,8 @@ class FromFavoriteSenders(WellknownFolder):
- CONTAINER_CLASS = "IPF.Note"
DISTINGUISHED_FOLDER_ID = "fromfavoritesenders"
+ CONTAINER_CLASS = "IPF.Note"
LOCALIZED_NAMES = {
"da_DK": ("Personer jeg kender",),
}
@@ -7525,7 +7603,7 @@ class GALContacts(NonDeletableFolder):
CONTAINER_CLASS = "IPF.Contact.GalContacts"
- supported_item_models = (Contact, DistributionList)
+ supported_item_models = CONTACT_ITEM_CLASSES
LOCALIZED_NAMES = {
None: ("GAL Contacts",),
}
@@ -7674,8 +7752,8 @@ class IMContactList(WellknownFolder):
- CONTAINER_CLASS = "IPF.Contact.MOC.ImContactList"
DISTINGUISHED_FOLDER_ID = "imcontactlist"
+ CONTAINER_CLASS = "IPF.Contact.MOC.ImContactList"
supported_from = EXCHANGE_2013
class Inbox(Messages):
+class Inbox(WellknownFolder):
+ CONTAINER_CLASS = "IPF.Note"
DISTINGUISHED_FOLDER_ID = "inbox"
+ supported_item_models = MESSAGE_ITEM_CLASSES
LOCALIZED_NAMES = {
"da_DK": ("Indbakke",),
"de_DE": ("Posteingang",),
@@ -7768,7 +7848,6 @@ Inherited members
Ancestors
-- Messages
- WellknownFolder
- Folder
- BaseFolder
@@ -7780,6 +7859,10 @@ Ancestors
Class variables
+var CONTAINER_CLASS
+-
+
+
var DISTINGUISHED_FOLDER_ID
-
@@ -7788,41 +7871,45 @@
Class variables
-
+ var supported_item_models
+-
+
+
Inherited members
-Messages
:
+WellknownFolder
:
-ID_ELEMENT_CLS
-account
-add_field
-all
-deregister
-exclude
-filter
-folder_cls_from_container_class
-folder_sync_state
-get
-get_distinguished
-get_events
-get_streaming_events
-item_sync_state
-none
-parent
-people
-register
-remove_field
-root
-subscribe_to_pull
-subscribe_to_push
-subscribe_to_streaming
-supported_fields
-sync_hierarchy
-sync_items
-test_access
-tree
-unsubscribe
-validate_field
+ID_ELEMENT_CLS
+account
+add_field
+all
+deregister
+exclude
+filter
+folder_cls_from_container_class
+folder_sync_state
+get
+get_distinguished
+get_events
+get_streaming_events
+item_sync_state
+none
+parent
+people
+register
+remove_field
+root
+subscribe_to_pull
+subscribe_to_push
+subscribe_to_streaming
+supported_fields
+sync_hierarchy
+sync_items
+test_access
+tree
+unsubscribe
+validate_field
@@ -7980,8 +8067,10 @@ Inherited members
Expand source code
-class JunkEmail(Messages):
+class JunkEmail(WellknownFolder):
+ CONTAINER_CLASS = "IPF.Note"
DISTINGUISHED_FOLDER_ID = "junkemail"
+ supported_item_models = MESSAGE_ITEM_CLASSES
LOCALIZED_NAMES = {
"da_DK": ("Uønsket e-mail",),
"de_DE": ("Junk-E-Mail",),
@@ -7996,7 +8085,6 @@ Inherited members
Ancestors
-- Messages
- WellknownFolder
- Folder
- BaseFolder
@@ -8008,6 +8096,10 @@ Ancestors
Class variables
+var CONTAINER_CLASS
+-
+
+
var DISTINGUISHED_FOLDER_ID
-
@@ -8016,41 +8108,45 @@
Class variables
-
+ var supported_item_models
+-
+
+
Inherited members
-Messages
:
+WellknownFolder
:
-ID_ELEMENT_CLS
-account
-add_field
-all
-deregister
-exclude
-filter
-folder_cls_from_container_class
-folder_sync_state
-get
-get_distinguished
-get_events
-get_streaming_events
-item_sync_state
-none
-parent
-people
-register
-remove_field
-root
-subscribe_to_pull
-subscribe_to_push
-subscribe_to_streaming
-supported_fields
-sync_hierarchy
-sync_items
-test_access
-tree
-unsubscribe
-validate_field
+ID_ELEMENT_CLS
+account
+add_field
+all
+deregister
+exclude
+filter
+folder_cls_from_container_class
+folder_sync_state
+get
+get_distinguished
+get_events
+get_streaming_events
+item_sync_state
+none
+parent
+people
+register
+remove_field
+root
+subscribe_to_pull
+subscribe_to_push
+subscribe_to_streaming
+supported_fields
+sync_hierarchy
+sync_items
+test_access
+tree
+unsubscribe
+validate_field
@@ -8265,7 +8361,7 @@ Inherited members
class Messages(WellknownFolder):
CONTAINER_CLASS = "IPF.Note"
- supported_item_models = (Message, MeetingRequest, MeetingResponse, MeetingCancellation)
+ supported_item_models = MESSAGE_ITEM_CLASSES
Ancestors
@@ -8280,9 +8376,6 @@ Ancestors
Subclasses
@@ -8506,7 +8599,7 @@ Inherited members
class MyContactsExtended(NonDeletableFolder):
CONTAINER_CLASS = "IPF.Note"
- supported_item_models = (Contact, DistributionList)
+ supported_item_models = CONTACT_ITEM_CLASSES
Ancestors
@@ -8601,6 +8694,7 @@ Subclasses
- ApplicationData
- Audits
- CalendarLogging
+- CalendarSearchCache
- CommonViews
- ConversationSettings
- DefaultFoldersChangeHistory
@@ -8619,6 +8713,7 @@ Subclasses
- ParkedMessages
- PassThroughSearchResults
- PdpProfileV2Secured
+- PersonMetadata
- RSSFeeds
- Reminders
- Schedule
@@ -8777,7 +8872,8 @@ Inherited members
Expand source code
class OneNotePagePreviews(WellknownFolder):
- DISTINGUISHED_FOLDER_ID = "onenotepagepreviews"
+ DISTINGUISHED_FOLDER_ID = "onenotepagepreviews"
+ supported_from = EXCHANGE_O365
Ancestors
@@ -8796,6 +8892,10 @@ Class variables
-
+var supported_from
+-
+
+
Inherited members
@@ -8847,7 +8947,7 @@ Inherited members
class OrganizationalContacts(NonDeletableFolder):
CONTAINER_CLASS = "IPF.Contact.OrganizationalContacts"
- supported_item_models = (Contact, DistributionList)
+ supported_item_models = CONTACT_ITEM_CLASSES
LOCALIZED_NAMES = {
None: ("Organizational Contacts",),
}
@@ -9370,6 +9470,75 @@ Inherited members
+
+class PersonMetadata
+(**kwargs)
+
+
+A mixin for non-wellknown folders than that are not deletable.
+
+
+Expand source code
+
+class PersonMetadata(NonDeletableFolder):
+ CONTAINER_CLASS = "IPF.Contact"
+
+Ancestors
+
+- NonDeletableFolder
+- Folder
+- BaseFolder
+- RegisterMixIn
+- IdChangeKeyMixIn
+- EWSElement
+- SearchableMixIn
+- SupportedVersionClassMixIn
+
+Class variables
+
+var CONTAINER_CLASS
+-
+
+
+
+Inherited members
+
+NonDeletableFolder
:
+
+ID_ELEMENT_CLS
+account
+add_field
+all
+deregister
+exclude
+filter
+folder_cls_from_container_class
+folder_sync_state
+get
+get_distinguished
+get_events
+get_streaming_events
+item_sync_state
+none
+parent
+people
+register
+remove_field
+root
+subscribe_to_pull
+subscribe_to_push
+subscribe_to_streaming
+supported_fields
+sync_hierarchy
+sync_items
+test_access
+tree
+unsubscribe
+validate_field
+
+
+
+
class PublicFoldersRoot
(**kwargs)
@@ -9553,7 +9722,8 @@ Inherited members
Expand source code
class QedcDefaultRetention(WellknownFolder):
- DISTINGUISHED_FOLDER_ID = "qedcdefaultretention"
+ DISTINGUISHED_FOLDER_ID = "qedcdefaultretention"
+ supported_from = EXCHANGE_O365
var supported_from
class QedcLongRetention(WellknownFolder):
- DISTINGUISHED_FOLDER_ID = "qedclongretention"
+ DISTINGUISHED_FOLDER_ID = "qedclongretention"
+ supported_from = EXCHANGE_O365
var supported_from
class QedcMediumRetention(WellknownFolder):
- DISTINGUISHED_FOLDER_ID = "qedcmediumretention"
+ DISTINGUISHED_FOLDER_ID = "qedcmediumretention"
+ supported_from = EXCHANGE_O365
var supported_from
class QedcShortRetention(WellknownFolder):
- DISTINGUISHED_FOLDER_ID = "qedcshortretention"
+ DISTINGUISHED_FOLDER_ID = "qedcshortretention"
+ supported_from = EXCHANGE_O365
var supported_from
class QuarantinedEmail(WellknownFolder):
- DISTINGUISHED_FOLDER_ID = "quarantinedemail"
+ DISTINGUISHED_FOLDER_ID = "quarantinedemail"
+ supported_from = EXCHANGE_O365
var supported_from
class QuarantinedEmailDefaultCategory(WellknownFolder):
- DISTINGUISHED_FOLDER_ID = "quarantinedemaildefaultcategory"
+ DISTINGUISHED_FOLDER_ID = "quarantinedemaildefaultcategory"
+ supported_from = EXCHANGE_O365
var supported_from
class QuickContacts(WellknownFolder):
- CONTAINER_CLASS = "IPF.Contact.MOC.QuickContacts"
DISTINGUISHED_FOLDER_ID = "quickcontacts"
+ CONTAINER_CLASS = "IPF.Contact.MOC.QuickContacts"
supported_from = EXCHANGE_2013
class RecipientCache(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "recipientcache"
CONTAINER_CLASS = "IPF.Contact.RecipientCache"
- supported_from = EXCHANGE_2013
- LOCALIZED_NAMES = {
- None: ("RecipientCache",),
- }
+ supported_from = EXCHANGE_2013
var LOCALIZED_NAMES
var supported_from
class RecoverableItemsSubstrateHolds(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "recoverableitemssubstrateholds"
- supported_from = EXCHANGE_2010_SP1
+ supported_from = EXCHANGE_O365
LOCALIZED_NAMES = {
None: ("SubstrateHolds",),
}
@@ -10654,10 +10846,7 @@ class RelevantContacts(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "relevantcontacts"
- CONTAINER_CLASS = "IPF.Note"
- LOCALIZED_NAMES = {
- None: ("RelevantContacts",),
- }
+ CONTAINER_CLASS = "IPF.Note"
var LOCALIZED_NAMES
class ShortNotes(WellknownFolder):
- DISTINGUISHED_FOLDER_ID = "shortnotes"
+ DISTINGUISHED_FOLDER_ID = "shortnotes"
+ supported_from = EXCHANGE_O365
var supported_from
class Tasks(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "tasks"
CONTAINER_CLASS = "IPF.Task"
- supported_item_models = (Task,)
+ supported_item_models = TASK_ITEM_CLASSES
LOCALIZED_NAMES = {
"da_DK": ("Opgaver",),
"de_DE": ("Aufgaben",),
@@ -12850,8 +13040,8 @@ Inherited members
Expand source code
class ToDoSearch(WellknownFolder):
- CONTAINER_CLASS = "IPF.Task"
DISTINGUISHED_FOLDER_ID = "todosearch"
+ CONTAINER_CLASS = "IPF.Task"
supported_from = EXCHANGE_2013
LOCALIZED_NAMES = {
None: ("To-Do Search",),
@@ -12936,8 +13126,9 @@ Inherited members
Expand source code
class UserCuratedContacts(WellknownFolder):
+ DISTINGUISHED_FOLDER_ID = "usercuratedcontacts"
CONTAINER_CLASS = "IPF.Note"
- DISTINGUISHED_FOLDER_ID = "usercuratedcontacts"
+ supported_from = EXCHANGE_O365
Ancestors
@@ -12960,6 +13151,10 @@ Class variables
-
+var supported_from
+-
+
+
Inherited members
@@ -13189,11 +13384,14 @@ Subclasses
- DeletedItems
- Directory
- DlpPolicyEvaluation
+- Drafts
- Favorites
- FromFavoriteSenders
- IMContactList
+- Inbox
- Inference
- Journal
+- JunkEmail
- LocalFailures
- Messages
- MsgFolderRoot
@@ -13381,6 +13579,7 @@
CONTAINER_CLASS
DISTINGUISHED_FOLDER_ID
+supported_from
-
@@ -13408,8 +13607,6 @@
AllTodoTasks
@@ -13577,6 +13774,12 @@ CalendarSearchCache
+
+
+-
CommonViews
-
Drafts
-
@@ -13693,8 +13899,6 @@
ExternalContacts
@@ -13827,8 +14031,10 @@ Inbox
-
@@ -13847,8 +14053,10 @@
JunkEmail
-
@@ -13911,6 +14119,7 @@
OneNotePagePreviews
-
@@ -13963,6 +14172,12 @@
PersonMetadata
+
+
+-
PublicFoldersRoot
DEFAULT_FOLDER_TRAVERSAL_DEPTH
@@ -13975,36 +14190,42 @@ QedcDefaultRetention
-
QedcLongRetention
-
QedcMediumRetention
-
QedcShortRetention
-
QuarantinedEmail
-
QuarantinedEmailDefaultCategory
-
@@ -14027,7 +14248,6 @@
CONTAINER_CLASS
DISTINGUISHED_FOLDER_ID
-LOCALIZED_NAMES
supported_from
@@ -14078,7 +14298,6 @@
CONTAINER_CLASS
DISTINGUISHED_FOLDER_ID
-LOCALIZED_NAMES
ShortNotes
CONTAINER_CLASS
DISTINGUISHED_FOLDER_ID
+supported_from
exchangelib.folders.known_folders
from ..items import (
ASSOCIATED,
+ CONTACT_ITEM_CLASSES,
ITEM_CLASSES,
+ MESSAGE_ITEM_CLASSES,
+ TASK_ITEM_CLASSES,
CalendarItem,
- Contact,
- DistributionList,
- MeetingCancellation,
- MeetingRequest,
- MeetingResponse,
- Message,
- Task,
)
from ..properties import EWSMeta
-from ..version import EXCHANGE_2010_SP1, EXCHANGE_2013, EXCHANGE_2013_SP1
+from ..version import EXCHANGE_2010_SP1, EXCHANGE_2013, EXCHANGE_2013_SP1, EXCHANGE_O365
from .base import Folder
from .collections import FolderCollection
@@ -84,165 +80,18 @@ Module exchangelib.folders.known_folders
supported_item_models = ITEM_CLASSES
-class Messages(WellknownFolder):
- CONTAINER_CLASS = "IPF.Note"
- supported_item_models = (Message, MeetingRequest, MeetingResponse, MeetingCancellation)
-
-
-class Calendar(WellknownFolder):
- """An interface for the Exchange calendar."""
-
- DISTINGUISHED_FOLDER_ID = "calendar"
- CONTAINER_CLASS = "IPF.Appointment"
- supported_item_models = (CalendarItem,)
- LOCALIZED_NAMES = {
- "da_DK": ("Kalender",),
- "de_DE": ("Kalender",),
- "en_US": ("Calendar",),
- "es_ES": ("Calendario",),
- "fr_CA": ("Calendrier",),
- "nl_NL": ("Agenda",),
- "ru_RU": ("Календарь",),
- "sv_SE": ("Kalender",),
- "zh_CN": ("日历",),
- }
-
- def view(self, *args, **kwargs):
- return FolderCollection(account=self.account, folders=[self]).view(*args, **kwargs)
-
-
-class Contacts(WellknownFolder):
- DISTINGUISHED_FOLDER_ID = "contacts"
- CONTAINER_CLASS = "IPF.Contact"
- supported_item_models = (Contact, DistributionList)
- LOCALIZED_NAMES = {
- "da_DK": ("Kontaktpersoner",),
- "de_DE": ("Kontakte",),
- "en_US": ("Contacts",),
- "es_ES": ("Contactos",),
- "fr_CA": ("Contacts",),
- "nl_NL": ("Contactpersonen",),
- "ru_RU": ("Контакты",),
- "sv_SE": ("Kontakter",),
- "zh_CN": ("联系人",),
- }
-
-
-class DeletedItems(WellknownFolder):
- DISTINGUISHED_FOLDER_ID = "deleteditems"
- CONTAINER_CLASS = "IPF.Note"
- supported_item_models = ITEM_CLASSES
- LOCALIZED_NAMES = {
- "da_DK": ("Slettet post",),
- "de_DE": ("Gelöschte Elemente",),
- "en_US": ("Deleted Items",),
- "es_ES": ("Elementos eliminados",),
- "fr_CA": ("Éléments supprimés",),
- "nl_NL": ("Verwijderde items",),
- "ru_RU": ("Удаленные",),
- "sv_SE": ("Borttaget",),
- "zh_CN": ("已删除邮件",),
- }
-
-
-class Drafts(Messages):
- DISTINGUISHED_FOLDER_ID = "drafts"
- LOCALIZED_NAMES = {
- "da_DK": ("Kladder",),
- "de_DE": ("Entwürfe",),
- "en_US": ("Drafts",),
- "es_ES": ("Borradores",),
- "fr_CA": ("Brouillons",),
- "nl_NL": ("Concepten",),
- "ru_RU": ("Черновики",),
- "sv_SE": ("Utkast",),
- "zh_CN": ("草稿",),
- }
-
-
-class Inbox(Messages):
- DISTINGUISHED_FOLDER_ID = "inbox"
- LOCALIZED_NAMES = {
- "da_DK": ("Indbakke",),
- "de_DE": ("Posteingang",),
- "en_US": ("Inbox",),
- "es_ES": ("Bandeja de entrada",),
- "fr_CA": ("Boîte de réception",),
- "nl_NL": ("Postvak IN",),
- "ru_RU": ("Входящие",),
- "sv_SE": ("Inkorgen",),
- "zh_CN": ("收件箱",),
- }
-
-
-class JunkEmail(Messages):
- DISTINGUISHED_FOLDER_ID = "junkemail"
- LOCALIZED_NAMES = {
- "da_DK": ("Uønsket e-mail",),
- "de_DE": ("Junk-E-Mail",),
- "en_US": ("Junk E-mail",),
- "es_ES": ("Correo no deseado",),
- "fr_CA": ("Courrier indésirables",),
- "nl_NL": ("Ongewenste e-mail",),
- "ru_RU": ("Нежелательная почта",),
- "sv_SE": ("Skräppost",),
- "zh_CN": ("垃圾邮件",),
- }
-
-
-class Outbox(Messages):
- DISTINGUISHED_FOLDER_ID = "outbox"
- LOCALIZED_NAMES = {
- "da_DK": ("Udbakke",),
- "de_DE": ("Postausgang",),
- "en_US": ("Outbox",),
- "es_ES": ("Bandeja de salida",),
- "fr_CA": ("Boîte d'envoi",),
- "nl_NL": ("Postvak UIT",),
- "ru_RU": ("Исходящие",),
- "sv_SE": ("Utkorgen",),
- "zh_CN": ("发件箱",),
- }
-
-
-class SentItems(Messages):
- DISTINGUISHED_FOLDER_ID = "sentitems"
- LOCALIZED_NAMES = {
- "da_DK": ("Sendt post",),
- "de_DE": ("Gesendete Elemente",),
- "en_US": ("Sent Items",),
- "es_ES": ("Elementos enviados",),
- "fr_CA": ("Éléments envoyés",),
- "nl_NL": ("Verzonden items",),
- "ru_RU": ("Отправленные",),
- "sv_SE": ("Skickat",),
- "zh_CN": ("已发送邮件",),
- }
-
-
-class Tasks(WellknownFolder):
- DISTINGUISHED_FOLDER_ID = "tasks"
- CONTAINER_CLASS = "IPF.Task"
- supported_item_models = (Task,)
- LOCALIZED_NAMES = {
- "da_DK": ("Opgaver",),
- "de_DE": ("Aufgaben",),
- "en_US": ("Tasks",),
- "es_ES": ("Tareas",),
- "fr_CA": ("Tâches",),
- "nl_NL": ("Taken",),
- "ru_RU": ("Задачи",),
- "sv_SE": ("Uppgifter",),
- "zh_CN": ("任务",),
- }
-
-
class AdminAuditLogs(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "adminauditlogs"
supported_from = EXCHANGE_2013
get_folder_allowed = False
+class AllCategorizedItems(WellknownFolder):
+ DISTINGUISHED_FOLDER_ID = "allcategorizeditems"
+ CONTAINER_CLASS = "IPF.Note"
+ supported_from = EXCHANGE_O365
+
+
class AllContacts(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "allcontacts"
CONTAINER_CLASS = "IPF.Note"
@@ -253,11 +102,6 @@ Module exchangelib.folders.known_folders
CONTAINER_CLASS = "IPF"
-class AllCategorizedItems(WellknownFolder):
- DISTINGUISHED_FOLDER_ID = "allcategorizeditems"
- CONTAINER_CLASS = "IPF.Note"
-
-
class AllPersonMetadata(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "allpersonmetadata"
CONTAINER_CLASS = "IPF.Note"
@@ -298,10 +142,32 @@ Module exchangelib.folders.known_folders
supported_from = EXCHANGE_2010_SP1
+class Calendar(WellknownFolder):
+ """An interface for the Exchange calendar."""
+
+ DISTINGUISHED_FOLDER_ID = "calendar"
+ CONTAINER_CLASS = "IPF.Appointment"
+ supported_item_models = (CalendarItem,)
+ LOCALIZED_NAMES = {
+ "da_DK": ("Kalender",),
+ "de_DE": ("Kalender",),
+ "en_US": ("Calendar",),
+ "es_ES": ("Calendario",),
+ "fr_CA": ("Calendrier",),
+ "nl_NL": ("Agenda",),
+ "ru_RU": ("Календарь",),
+ "sv_SE": ("Kalender",),
+ "zh_CN": ("日历",),
+ }
+
+ def view(self, *args, **kwargs):
+ return FolderCollection(account=self.account, folders=[self]).view(*args, **kwargs)
+
+
class Companies(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "companycontacts"
CONTAINER_CLASS = "IPF.Contact.Company"
- supported_item_models = (Contact, DistributionList)
+ supported_item_models = CONTACT_ITEM_CLASSES
LOCALIZED_NAMES = {
"da_DK": ("Firmaer",),
}
@@ -312,11 +178,45 @@ Module exchangelib.folders.known_folders
supported_from = EXCHANGE_2013
+class Contacts(WellknownFolder):
+ DISTINGUISHED_FOLDER_ID = "contacts"
+ CONTAINER_CLASS = "IPF.Contact"
+ supported_item_models = CONTACT_ITEM_CLASSES
+ LOCALIZED_NAMES = {
+ "da_DK": ("Kontaktpersoner",),
+ "de_DE": ("Kontakte",),
+ "en_US": ("Contacts",),
+ "es_ES": ("Contactos",),
+ "fr_CA": ("Contacts",),
+ "nl_NL": ("Contactpersonen",),
+ "ru_RU": ("Контакты",),
+ "sv_SE": ("Kontakter",),
+ "zh_CN": ("联系人",),
+ }
+
+
class ConversationHistory(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "conversationhistory"
supported_from = EXCHANGE_2013
+class DeletedItems(WellknownFolder):
+ DISTINGUISHED_FOLDER_ID = "deleteditems"
+ CONTAINER_CLASS = "IPF.Note"
+ supported_item_models = ITEM_CLASSES
+ LOCALIZED_NAMES = {
+ "da_DK": ("Slettet post",),
+ "de_DE": ("Gelöschte Elemente",),
+ "en_US": ("Deleted Items",),
+ "es_ES": ("Elementos eliminados",),
+ "fr_CA": ("Éléments supprimés",),
+ "nl_NL": ("Verwijderde items",),
+ "ru_RU": ("Удаленные",),
+ "sv_SE": ("Borttaget",),
+ "zh_CN": ("已删除邮件",),
+ }
+
+
class Directory(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "directory"
supported_from = EXCHANGE_2013_SP1
@@ -325,11 +225,29 @@ Module exchangelib.folders.known_folders
class DlpPolicyEvaluation(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "dlppolicyevaluation"
CONTAINER_CLASS = "IPF.StoreItem.DlpPolicyEvaluation"
+ supported_from = EXCHANGE_O365
-class Favorites(WellknownFolder):
+class Drafts(WellknownFolder):
CONTAINER_CLASS = "IPF.Note"
+ DISTINGUISHED_FOLDER_ID = "drafts"
+ supported_item_models = MESSAGE_ITEM_CLASSES
+ LOCALIZED_NAMES = {
+ "da_DK": ("Kladder",),
+ "de_DE": ("Entwürfe",),
+ "en_US": ("Drafts",),
+ "es_ES": ("Borradores",),
+ "fr_CA": ("Brouillons",),
+ "nl_NL": ("Concepten",),
+ "ru_RU": ("Черновики",),
+ "sv_SE": ("Utkast",),
+ "zh_CN": ("草稿",),
+ }
+
+
+class Favorites(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "favorites"
+ CONTAINER_CLASS = "IPF.Note"
supported_from = EXCHANGE_2013
@@ -341,19 +259,36 @@ Module exchangelib.folders.known_folders
class FromFavoriteSenders(WellknownFolder):
- CONTAINER_CLASS = "IPF.Note"
DISTINGUISHED_FOLDER_ID = "fromfavoritesenders"
+ CONTAINER_CLASS = "IPF.Note"
LOCALIZED_NAMES = {
"da_DK": ("Personer jeg kender",),
}
class IMContactList(WellknownFolder):
- CONTAINER_CLASS = "IPF.Contact.MOC.ImContactList"
DISTINGUISHED_FOLDER_ID = "imcontactlist"
+ CONTAINER_CLASS = "IPF.Contact.MOC.ImContactList"
supported_from = EXCHANGE_2013
+class Inbox(WellknownFolder):
+ CONTAINER_CLASS = "IPF.Note"
+ DISTINGUISHED_FOLDER_ID = "inbox"
+ supported_item_models = MESSAGE_ITEM_CLASSES
+ LOCALIZED_NAMES = {
+ "da_DK": ("Indbakke",),
+ "de_DE": ("Posteingang",),
+ "en_US": ("Inbox",),
+ "es_ES": ("Bandeja de entrada",),
+ "fr_CA": ("Boîte de réception",),
+ "nl_NL": ("Postvak IN",),
+ "ru_RU": ("Входящие",),
+ "sv_SE": ("Inkorgen",),
+ "zh_CN": ("收件箱",),
+ }
+
+
class Inference(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "inference"
@@ -363,11 +298,33 @@ Module exchangelib.folders.known_folders
DISTINGUISHED_FOLDER_ID = "journal"
+class JunkEmail(WellknownFolder):
+ CONTAINER_CLASS = "IPF.Note"
+ DISTINGUISHED_FOLDER_ID = "junkemail"
+ supported_item_models = MESSAGE_ITEM_CLASSES
+ LOCALIZED_NAMES = {
+ "da_DK": ("Uønsket e-mail",),
+ "de_DE": ("Junk-E-Mail",),
+ "en_US": ("Junk E-mail",),
+ "es_ES": ("Correo no deseado",),
+ "fr_CA": ("Courrier indésirables",),
+ "nl_NL": ("Ongewenste e-mail",),
+ "ru_RU": ("Нежелательная почта",),
+ "sv_SE": ("Skräppost",),
+ "zh_CN": ("垃圾邮件",),
+ }
+
+
class LocalFailures(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "localfailures"
supported_from = EXCHANGE_2013
+class Messages(WellknownFolder):
+ CONTAINER_CLASS = "IPF.Note"
+ supported_item_models = MESSAGE_ITEM_CLASSES
+
+
class MsgFolderRoot(WellknownFolder):
"""Also known as the 'Top of Information Store' folder."""
@@ -395,6 +352,22 @@ Module exchangelib.folders.known_folders
class OneNotePagePreviews(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "onenotepagepreviews"
+ supported_from = EXCHANGE_O365
+
+
+class Outbox(Messages):
+ DISTINGUISHED_FOLDER_ID = "outbox"
+ LOCALIZED_NAMES = {
+ "da_DK": ("Udbakke",),
+ "de_DE": ("Postausgang",),
+ "en_US": ("Outbox",),
+ "es_ES": ("Bandeja de salida",),
+ "fr_CA": ("Boîte d'envoi",),
+ "nl_NL": ("Postvak UIT",),
+ "ru_RU": ("Исходящие",),
+ "sv_SE": ("Utkorgen",),
+ "zh_CN": ("发件箱",),
+ }
class PeopleCentricConversationBuddies(WellknownFolder):
@@ -412,31 +385,37 @@ Module exchangelib.folders.known_folders
class QedcDefaultRetention(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "qedcdefaultretention"
+ supported_from = EXCHANGE_O365
class QedcLongRetention(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "qedclongretention"
+ supported_from = EXCHANGE_O365
class QedcMediumRetention(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "qedcmediumretention"
+ supported_from = EXCHANGE_O365
class QedcShortRetention(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "qedcshortretention"
+ supported_from = EXCHANGE_O365
class QuarantinedEmail(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "quarantinedemail"
+ supported_from = EXCHANGE_O365
class QuarantinedEmailDefaultCategory(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "quarantinedemaildefaultcategory"
+ supported_from = EXCHANGE_O365
class QuickContacts(WellknownFolder):
- CONTAINER_CLASS = "IPF.Contact.MOC.QuickContacts"
DISTINGUISHED_FOLDER_ID = "quickcontacts"
+ CONTAINER_CLASS = "IPF.Contact.MOC.QuickContacts"
supported_from = EXCHANGE_2013
@@ -444,17 +423,11 @@ Module exchangelib.folders.known_folders
DISTINGUISHED_FOLDER_ID = "recipientcache"
CONTAINER_CLASS = "IPF.Contact.RecipientCache"
supported_from = EXCHANGE_2013
- LOCALIZED_NAMES = {
- None: ("RecipientCache",),
- }
class RelevantContacts(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "relevantcontacts"
CONTAINER_CLASS = "IPF.Note"
- LOCALIZED_NAMES = {
- None: ("RelevantContacts",),
- }
class RecoverableItemsDeletions(WellknownFolder):
@@ -474,7 +447,7 @@ Module exchangelib.folders.known_folders
class RecoverableItemsSubstrateHolds(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "recoverableitemssubstrateholds"
- supported_from = EXCHANGE_2010_SP1
+ supported_from = EXCHANGE_O365
LOCALIZED_NAMES = {
None: ("SubstrateHolds",),
}
@@ -489,6 +462,21 @@ Module exchangelib.folders.known_folders
DISTINGUISHED_FOLDER_ID = "searchfolders"
+class SentItems(Messages):
+ DISTINGUISHED_FOLDER_ID = "sentitems"
+ LOCALIZED_NAMES = {
+ "da_DK": ("Sendt post",),
+ "de_DE": ("Gesendete Elemente",),
+ "en_US": ("Sent Items",),
+ "es_ES": ("Elementos enviados",),
+ "fr_CA": ("Éléments envoyés",),
+ "nl_NL": ("Verzonden items",),
+ "ru_RU": ("Отправленные",),
+ "sv_SE": ("Skickat",),
+ "zh_CN": ("已发送邮件",),
+ }
+
+
class ServerFailures(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "serverfailures"
supported_from = EXCHANGE_2013
@@ -500,6 +488,7 @@ Module exchangelib.folders.known_folders
class ShortNotes(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "shortnotes"
+ supported_from = EXCHANGE_O365
class SyncIssues(WellknownFolder):
@@ -508,13 +497,30 @@ Module exchangelib.folders.known_folders
supported_from = EXCHANGE_2013
+class Tasks(WellknownFolder):
+ DISTINGUISHED_FOLDER_ID = "tasks"
+ CONTAINER_CLASS = "IPF.Task"
+ supported_item_models = TASK_ITEM_CLASSES
+ LOCALIZED_NAMES = {
+ "da_DK": ("Opgaver",),
+ "de_DE": ("Aufgaben",),
+ "en_US": ("Tasks",),
+ "es_ES": ("Tareas",),
+ "fr_CA": ("Tâches",),
+ "nl_NL": ("Taken",),
+ "ru_RU": ("Задачи",),
+ "sv_SE": ("Uppgifter",),
+ "zh_CN": ("任务",),
+ }
+
+
class TemporarySaves(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "temporarysaves"
class ToDoSearch(WellknownFolder):
- CONTAINER_CLASS = "IPF.Task"
DISTINGUISHED_FOLDER_ID = "todosearch"
+ CONTAINER_CLASS = "IPF.Task"
supported_from = EXCHANGE_2013
LOCALIZED_NAMES = {
None: ("To-Do Search",),
@@ -522,8 +528,9 @@ Module exchangelib.folders.known_folders
class UserCuratedContacts(WellknownFolder):
- CONTAINER_CLASS = "IPF.Note"
DISTINGUISHED_FOLDER_ID = "usercuratedcontacts"
+ CONTAINER_CLASS = "IPF.Note"
+ supported_from = EXCHANGE_O365
class VoiceMail(WellknownFolder):
@@ -542,22 +549,9 @@ Module exchangelib.folders.known_folders
return False
-class ExternalContacts(NonDeletableFolder):
- DISTINGUISHED_FOLDER_ID = None
- CONTAINER_CLASS = "IPF.Contact"
- supported_item_models = (Contact, DistributionList)
- LOCALIZED_NAMES = {
- None: ("ExternalContacts",),
- }
-
-
class AllTodoTasks(NonDeletableFolder):
- DISTINGUISHED_FOLDER_ID = None
CONTAINER_CLASS = "IPF.Task"
- supported_item_models = (Task,)
- LOCALIZED_NAMES = {
- None: ("AllTodoTasks",),
- }
+ supported_item_models = TASK_ITEM_CLASSES
class ApplicationData(NonDeletableFolder):
@@ -574,6 +568,10 @@ Module exchangelib.folders.known_folders
}
+class CalendarSearchCache(NonDeletableFolder):
+ CONTAINER_CLASS = "IPF.Appointment"
+
+
class CommonViews(NonDeletableFolder):
DEFAULT_ITEM_TRAVERSAL_DEPTH = ASSOCIATED
LOCALIZED_NAMES = {
@@ -602,6 +600,11 @@ Module exchangelib.folders.known_folders
pass
+class ExternalContacts(NonDeletableFolder):
+ CONTAINER_CLASS = "IPF.Contact"
+ supported_item_models = CONTACT_ITEM_CLASSES
+
+
class Files(NonDeletableFolder):
CONTAINER_CLASS = "IPF.Files"
LOCALIZED_NAMES = {
@@ -617,7 +620,7 @@ Module exchangelib.folders.known_folders
class Friends(NonDeletableFolder):
CONTAINER_CLASS = "IPF.Note"
- supported_item_models = (Contact, DistributionList)
+ supported_item_models = CONTACT_ITEM_CLASSES
LOCALIZED_NAMES = {
"de_DE": ("Bekannte",),
}
@@ -625,7 +628,7 @@ Module exchangelib.folders.known_folders
class GALContacts(NonDeletableFolder):
CONTAINER_CLASS = "IPF.Contact.GalContacts"
- supported_item_models = (Contact, DistributionList)
+ supported_item_models = CONTACT_ITEM_CLASSES
LOCALIZED_NAMES = {
None: ("GAL Contacts",),
}
@@ -645,12 +648,12 @@ Module exchangelib.folders.known_folders
class MyContactsExtended(NonDeletableFolder):
CONTAINER_CLASS = "IPF.Note"
- supported_item_models = (Contact, DistributionList)
+ supported_item_models = CONTACT_ITEM_CLASSES
class OrganizationalContacts(NonDeletableFolder):
CONTAINER_CLASS = "IPF.Contact.OrganizationalContacts"
- supported_item_models = (Contact, DistributionList)
+ supported_item_models = CONTACT_ITEM_CLASSES
LOCALIZED_NAMES = {
None: ("Organizational Contacts",),
}
@@ -667,6 +670,10 @@ Module exchangelib.folders.known_folders
}
+class PersonMetadata(NonDeletableFolder):
+ CONTAINER_CLASS = "IPF.Contact"
+
+
class PdpProfileV2Secured(NonDeletableFolder):
CONTAINER_CLASS = "IPF.StoreItem.PdpProfileSecured"
@@ -732,18 +739,19 @@ Module exchangelib.folders.known_folders
# Folders that do not have a distinguished folder ID but return 'ErrorDeleteDistinguishedFolder' or
# 'ErrorCannotDeleteObject' when we try to delete them. I can't find any official docs listing these folders.
NON_DELETABLE_FOLDERS = [
- ApplicationData,
AllTodoTasks,
+ ApplicationData,
Audits,
CalendarLogging,
+ CalendarSearchCache,
CommonViews,
ConversationSettings,
DefaultFoldersChangeHistory,
DeferredAction,
ExchangeSyncData,
ExternalContacts,
- FreebusyData,
Files,
+ FreebusyData,
Friends,
GALContacts,
GraphAnalytics,
@@ -754,8 +762,9 @@ Module exchangelib.folders.known_folders
ParkedMessages,
PassThroughSearchResults,
PdpProfileV2Secured,
- Reminders,
+ PersonMetadata,
RSSFeeds,
+ Reminders,
Schedule,
Sharing,
Shortcuts,
@@ -787,8 +796,8 @@ Module exchangelib.folders.known_folders
Favorites,
FromFavoriteSenders,
IMContactList,
- Inference,
Inbox,
+ Inference,
Journal,
JunkEmail,
LocalFailures,
@@ -807,12 +816,12 @@ Module exchangelib.folders.known_folders
QuarantinedEmailDefaultCategory,
QuickContacts,
RecipientCache,
- RelevantContacts,
RecoverableItemsDeletions,
RecoverableItemsPurges,
RecoverableItemsRoot,
RecoverableItemsSubstrateHolds,
RecoverableItemsVersions,
+ RelevantContacts,
SearchFolders,
SentItems,
ServerFailures,
@@ -839,14 +848,14 @@ Module exchangelib.folders.known_folders
# Folders that do not have a distinguished ID but have their own container class
MISC_FOLDERS = [
+ Birthdays,
CrawlerData,
EventCheckPoints,
FolderMemberships,
FreeBusyCache,
RecoveryPoints,
- SwssItems,
SkypeTeamsMessages,
- Birthdays,
+ SwssItems,
]
@@ -950,7 +959,8 @@ class AllCategorizedItems(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "allcategorizeditems"
- CONTAINER_CLASS = "IPF.Note"
+ CONTAINER_CLASS = "IPF.Note"
+ supported_from = EXCHANGE_O365
var supported_from
class AllTodoTasks(NonDeletableFolder):
- DISTINGUISHED_FOLDER_ID = None
CONTAINER_CLASS = "IPF.Task"
- supported_item_models = (Task,)
- LOCALIZED_NAMES = {
- None: ("AllTodoTasks",),
- }
+ supported_item_models = TASK_ITEM_CLASSES
var DISTINGUISHED_FOLDER_ID
var LOCALIZED_NAMES
var supported_item_models
+class CalendarSearchCache
+(**kwargs)
+
A mixin for non-wellknown folders than that are not deletable.
class CalendarSearchCache(NonDeletableFolder):
+ CONTAINER_CLASS = "IPF.Appointment"
+var CONTAINER_CLASS
NonDeletableFolder
:
+ID_ELEMENT_CLS
account
add_field
all
deregister
exclude
filter
folder_cls_from_container_class
folder_sync_state
get
get_distinguished
get_events
get_streaming_events
item_sync_state
none
parent
people
register
remove_field
root
subscribe_to_pull
subscribe_to_push
subscribe_to_streaming
supported_fields
sync_hierarchy
sync_items
test_access
tree
unsubscribe
validate_field
class CommonViews
(**kwargs)
@@ -2326,7 +2397,7 @@ Inherited members
class Companies(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "companycontacts"
CONTAINER_CLASS = "IPF.Contact.Company"
- supported_item_models = (Contact, DistributionList)
+ supported_item_models = CONTACT_ITEM_CLASSES
LOCALIZED_NAMES = {
"da_DK": ("Firmaer",),
}
@@ -2486,7 +2557,7 @@ Inherited members
class Contacts(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "contacts"
CONTAINER_CLASS = "IPF.Contact"
- supported_item_models = (Contact, DistributionList)
+ supported_item_models = CONTACT_ITEM_CLASSES
LOCALIZED_NAMES = {
"da_DK": ("Kontaktpersoner",),
"de_DE": ("Kontakte",),
@@ -3105,7 +3176,8 @@ Inherited members
class DlpPolicyEvaluation(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "dlppolicyevaluation"
- CONTAINER_CLASS = "IPF.StoreItem.DlpPolicyEvaluation"
+ CONTAINER_CLASS = "IPF.StoreItem.DlpPolicyEvaluation"
+ supported_from = EXCHANGE_O365
Ancestors
@@ -3128,6 +3200,10 @@ Class variables
-
+var supported_from
+-
+
+
Inherited members
@@ -3177,8 +3253,10 @@ Inherited members
Expand source code
-
class Drafts(Messages):
+class Drafts(WellknownFolder):
+ CONTAINER_CLASS = "IPF.Note"
DISTINGUISHED_FOLDER_ID = "drafts"
+ supported_item_models = MESSAGE_ITEM_CLASSES
LOCALIZED_NAMES = {
"da_DK": ("Kladder",),
"de_DE": ("Entwürfe",),
@@ -3193,7 +3271,6 @@ Inherited members
Ancestors
-- Messages
- WellknownFolder
- Folder
- BaseFolder
@@ -3205,6 +3282,10 @@ Ancestors
Class variables
+var CONTAINER_CLASS
+-
+
+
var DISTINGUISHED_FOLDER_ID
-
@@ -3213,41 +3294,45 @@
Class variables
-
+ var supported_item_models
+-
+
+
Inherited members
-Messages
:
+WellknownFolder
:
-ID_ELEMENT_CLS
-account
-add_field
-all
-deregister
-exclude
-filter
-folder_cls_from_container_class
-folder_sync_state
-get
-get_distinguished
-get_events
-get_streaming_events
-item_sync_state
-none
-parent
-people
-register
-remove_field
-root
-subscribe_to_pull
-subscribe_to_push
-subscribe_to_streaming
-supported_fields
-sync_hierarchy
-sync_items
-test_access
-tree
-unsubscribe
-validate_field
+ID_ELEMENT_CLS
+account
+add_field
+all
+deregister
+exclude
+filter
+folder_cls_from_container_class
+folder_sync_state
+get
+get_distinguished
+get_events
+get_streaming_events
+item_sync_state
+none
+parent
+people
+register
+remove_field
+root
+subscribe_to_pull
+subscribe_to_push
+subscribe_to_streaming
+supported_fields
+sync_hierarchy
+sync_items
+test_access
+tree
+unsubscribe
+validate_field
@@ -3393,12 +3478,8 @@ Inherited members
Expand source code
class ExternalContacts(NonDeletableFolder):
- DISTINGUISHED_FOLDER_ID = None
CONTAINER_CLASS = "IPF.Contact"
- supported_item_models = (Contact, DistributionList)
- LOCALIZED_NAMES = {
- None: ("ExternalContacts",),
- }
+ supported_item_models = CONTACT_ITEM_CLASSES
Ancestors
@@ -3417,14 +3498,6 @@ Class variables
-
-var DISTINGUISHED_FOLDER_ID
--
-
-
-var LOCALIZED_NAMES
--
-
-
var supported_item_models
-
@@ -3479,8 +3552,8 @@
Inherited members
Expand source code
class Favorites(WellknownFolder):
- CONTAINER_CLASS = "IPF.Note"
DISTINGUISHED_FOLDER_ID = "favorites"
+ CONTAINER_CLASS = "IPF.Note"
supported_from = EXCHANGE_2013
Ancestors
@@ -3849,7 +3922,7 @@ Inherited members
class Friends(NonDeletableFolder):
CONTAINER_CLASS = "IPF.Note"
- supported_item_models = (Contact, DistributionList)
+ supported_item_models = CONTACT_ITEM_CLASSES
LOCALIZED_NAMES = {
"de_DE": ("Bekannte",),
}
@@ -3929,8 +4002,8 @@ Inherited members
Expand source code
class FromFavoriteSenders(WellknownFolder):
- CONTAINER_CLASS = "IPF.Note"
DISTINGUISHED_FOLDER_ID = "fromfavoritesenders"
+ CONTAINER_CLASS = "IPF.Note"
LOCALIZED_NAMES = {
"da_DK": ("Personer jeg kender",),
}
@@ -4011,7 +4084,7 @@ Inherited members
class GALContacts(NonDeletableFolder):
CONTAINER_CLASS = "IPF.Contact.GalContacts"
- supported_item_models = (Contact, DistributionList)
+ supported_item_models = CONTACT_ITEM_CLASSES
LOCALIZED_NAMES = {
None: ("GAL Contacts",),
}
@@ -4160,8 +4233,8 @@ Inherited members
Expand source code
class IMContactList(WellknownFolder):
- CONTAINER_CLASS = "IPF.Contact.MOC.ImContactList"
DISTINGUISHED_FOLDER_ID = "imcontactlist"
+ CONTAINER_CLASS = "IPF.Contact.MOC.ImContactList"
supported_from = EXCHANGE_2013
Ancestors
@@ -4238,8 +4311,10 @@ Inherited members
Expand source code
-class Inbox(Messages):
+class Inbox(WellknownFolder):
+ CONTAINER_CLASS = "IPF.Note"
DISTINGUISHED_FOLDER_ID = "inbox"
+ supported_item_models = MESSAGE_ITEM_CLASSES
LOCALIZED_NAMES = {
"da_DK": ("Indbakke",),
"de_DE": ("Posteingang",),
@@ -4254,7 +4329,6 @@ Inherited members
Ancestors
-- Messages
- WellknownFolder
- Folder
- BaseFolder
@@ -4262,53 +4336,61 @@ Ancestors
- IdChangeKeyMixIn
- EWSElement
- SearchableMixIn
-- SupportedVersionClassMixIn
-
-Class variables
-
-var DISTINGUISHED_FOLDER_ID
--
-
-
-var LOCALIZED_NAMES
--
-
-
-
-Inherited members
-
-Messages
:
-
-ID_ELEMENT_CLS
-account
-add_field
-all
-deregister
-exclude
-filter
-folder_cls_from_container_class
-folder_sync_state
-get
-get_distinguished
-get_events
-get_streaming_events
-item_sync_state
-none
-parent
-people
-register
-remove_field
-root
-subscribe_to_pull
-subscribe_to_push
-subscribe_to_streaming
-supported_fields
-sync_hierarchy
-sync_items
-test_access
-tree
-unsubscribe
-validate_field
+- SupportedVersionClassMixIn
+
+Class variables
+
+var CONTAINER_CLASS
+-
+
+
+var DISTINGUISHED_FOLDER_ID
+-
+
+
+var LOCALIZED_NAMES
+-
+
+
+var supported_item_models
+-
+
+
+
+Inherited members
+
+WellknownFolder
:
+
+ID_ELEMENT_CLS
+account
+add_field
+all
+deregister
+exclude
+filter
+folder_cls_from_container_class
+folder_sync_state
+get
+get_distinguished
+get_events
+get_streaming_events
+item_sync_state
+none
+parent
+people
+register
+remove_field
+root
+subscribe_to_pull
+subscribe_to_push
+subscribe_to_streaming
+supported_fields
+sync_hierarchy
+sync_items
+test_access
+tree
+unsubscribe
+validate_field
@@ -4466,8 +4548,10 @@ Inherited members
Expand source code
-class JunkEmail(Messages):
+class JunkEmail(WellknownFolder):
+ CONTAINER_CLASS = "IPF.Note"
DISTINGUISHED_FOLDER_ID = "junkemail"
+ supported_item_models = MESSAGE_ITEM_CLASSES
LOCALIZED_NAMES = {
"da_DK": ("Uønsket e-mail",),
"de_DE": ("Junk-E-Mail",),
@@ -4482,7 +4566,6 @@ Inherited members
Ancestors
-- Messages
- WellknownFolder
- Folder
- BaseFolder
@@ -4494,6 +4577,10 @@ Ancestors
Class variables
+var CONTAINER_CLASS
+-
+
+
var DISTINGUISHED_FOLDER_ID
-
@@ -4502,41 +4589,45 @@
Class variables
-
+ var supported_item_models
+-
+
+
Inherited members
-Messages
:
+WellknownFolder
:
-ID_ELEMENT_CLS
-account
-add_field
-all
-deregister
-exclude
-filter
-folder_cls_from_container_class
-folder_sync_state
-get
-get_distinguished
-get_events
-get_streaming_events
-item_sync_state
-none
-parent
-people
-register
-remove_field
-root
-subscribe_to_pull
-subscribe_to_push
-subscribe_to_streaming
-supported_fields
-sync_hierarchy
-sync_items
-test_access
-tree
-unsubscribe
-validate_field
+ID_ELEMENT_CLS
+account
+add_field
+all
+deregister
+exclude
+filter
+folder_cls_from_container_class
+folder_sync_state
+get
+get_distinguished
+get_events
+get_streaming_events
+item_sync_state
+none
+parent
+people
+register
+remove_field
+root
+subscribe_to_pull
+subscribe_to_push
+subscribe_to_streaming
+supported_fields
+sync_hierarchy
+sync_items
+test_access
+tree
+unsubscribe
+validate_field
@@ -4751,7 +4842,7 @@ Inherited members
class Messages(WellknownFolder):
CONTAINER_CLASS = "IPF.Note"
- supported_item_models = (Message, MeetingRequest, MeetingResponse, MeetingCancellation)
+ supported_item_models = MESSAGE_ITEM_CLASSES
Ancestors
@@ -4766,9 +4857,6 @@ Ancestors
Subclasses
@@ -4992,7 +5080,7 @@ Inherited members
class MyContactsExtended(NonDeletableFolder):
CONTAINER_CLASS = "IPF.Note"
- supported_item_models = (Contact, DistributionList)
+ supported_item_models = CONTACT_ITEM_CLASSES
Ancestors
@@ -5087,6 +5175,7 @@ Subclasses
- ApplicationData
- Audits
- CalendarLogging
+- CalendarSearchCache
- CommonViews
- ConversationSettings
- DefaultFoldersChangeHistory
@@ -5105,6 +5194,7 @@ Subclasses
- ParkedMessages
- PassThroughSearchResults
- PdpProfileV2Secured
+- PersonMetadata
- RSSFeeds
- Reminders
- Schedule
@@ -5263,7 +5353,8 @@ Inherited members
Expand source code
class OneNotePagePreviews(WellknownFolder):
- DISTINGUISHED_FOLDER_ID = "onenotepagepreviews"
+ DISTINGUISHED_FOLDER_ID = "onenotepagepreviews"
+ supported_from = EXCHANGE_O365
Ancestors
@@ -5282,6 +5373,10 @@ Class variables
-
+var supported_from
+-
+
+
Inherited members
@@ -5333,7 +5428,7 @@ Inherited members
class OrganizationalContacts(NonDeletableFolder):
CONTAINER_CLASS = "IPF.Contact.OrganizationalContacts"
- supported_item_models = (Contact, DistributionList)
+ supported_item_models = CONTACT_ITEM_CLASSES
LOCALIZED_NAMES = {
None: ("Organizational Contacts",),
}
@@ -5856,6 +5951,75 @@ Inherited members
+
+class PersonMetadata
+(**kwargs)
+
+
+A mixin for non-wellknown folders than that are not deletable.
+
+
+Expand source code
+
+class PersonMetadata(NonDeletableFolder):
+ CONTAINER_CLASS = "IPF.Contact"
+
+Ancestors
+
+- NonDeletableFolder
+- Folder
+- BaseFolder
+- RegisterMixIn
+- IdChangeKeyMixIn
+- EWSElement
+- SearchableMixIn
+- SupportedVersionClassMixIn
+
+Class variables
+
+var CONTAINER_CLASS
+-
+
+
+
+Inherited members
+
+NonDeletableFolder
:
+
+ID_ELEMENT_CLS
+account
+add_field
+all
+deregister
+exclude
+filter
+folder_cls_from_container_class
+folder_sync_state
+get
+get_distinguished
+get_events
+get_streaming_events
+item_sync_state
+none
+parent
+people
+register
+remove_field
+root
+subscribe_to_pull
+subscribe_to_push
+subscribe_to_streaming
+supported_fields
+sync_hierarchy
+sync_items
+test_access
+tree
+unsubscribe
+validate_field
+
+
+
+
class QedcDefaultRetention
(**kwargs)
@@ -5867,7 +6031,8 @@ Inherited members
Expand source code
class QedcDefaultRetention(WellknownFolder):
- DISTINGUISHED_FOLDER_ID = "qedcdefaultretention"
+ DISTINGUISHED_FOLDER_ID = "qedcdefaultretention"
+ supported_from = EXCHANGE_O365
Ancestors
@@ -5886,6 +6051,10 @@ Class variables
-
+var supported_from
+-
+
+
Inherited members
@@ -5936,7 +6105,8 @@ Inherited members
Expand source code
class QedcLongRetention(WellknownFolder):
- DISTINGUISHED_FOLDER_ID = "qedclongretention"
+ DISTINGUISHED_FOLDER_ID = "qedclongretention"
+ supported_from = EXCHANGE_O365
var supported_from
class QedcMediumRetention(WellknownFolder):
- DISTINGUISHED_FOLDER_ID = "qedcmediumretention"
+ DISTINGUISHED_FOLDER_ID = "qedcmediumretention"
+ supported_from = EXCHANGE_O365
var supported_from
class QedcShortRetention(WellknownFolder):
- DISTINGUISHED_FOLDER_ID = "qedcshortretention"
+ DISTINGUISHED_FOLDER_ID = "qedcshortretention"
+ supported_from = EXCHANGE_O365
var supported_from
class QuarantinedEmail(WellknownFolder):
- DISTINGUISHED_FOLDER_ID = "quarantinedemail"
+ DISTINGUISHED_FOLDER_ID = "quarantinedemail"
+ supported_from = EXCHANGE_O365
var supported_from
class QuarantinedEmailDefaultCategory(WellknownFolder):
- DISTINGUISHED_FOLDER_ID = "quarantinedemaildefaultcategory"
+ DISTINGUISHED_FOLDER_ID = "quarantinedemaildefaultcategory"
+ supported_from = EXCHANGE_O365
var supported_from
class QuickContacts(WellknownFolder):
- CONTAINER_CLASS = "IPF.Contact.MOC.QuickContacts"
DISTINGUISHED_FOLDER_ID = "quickcontacts"
+ CONTAINER_CLASS = "IPF.Contact.MOC.QuickContacts"
supported_from = EXCHANGE_2013
class RecipientCache(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "recipientcache"
CONTAINER_CLASS = "IPF.Contact.RecipientCache"
- supported_from = EXCHANGE_2013
- LOCALIZED_NAMES = {
- None: ("RecipientCache",),
- }
+ supported_from = EXCHANGE_2013
var LOCALIZED_NAMES
var supported_from
class RecoverableItemsSubstrateHolds(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "recoverableitemssubstrateholds"
- supported_from = EXCHANGE_2010_SP1
+ supported_from = EXCHANGE_O365
LOCALIZED_NAMES = {
None: ("SubstrateHolds",),
}
@@ -6968,10 +7155,7 @@ class RelevantContacts(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "relevantcontacts"
- CONTAINER_CLASS = "IPF.Note"
- LOCALIZED_NAMES = {
- None: ("RelevantContacts",),
- }
+ CONTAINER_CLASS = "IPF.Note"
var LOCALIZED_NAMES
class ShortNotes(WellknownFolder):
- DISTINGUISHED_FOLDER_ID = "shortnotes"
+ DISTINGUISHED_FOLDER_ID = "shortnotes"
+ supported_from = EXCHANGE_O365
var supported_from
class Tasks(WellknownFolder):
DISTINGUISHED_FOLDER_ID = "tasks"
CONTAINER_CLASS = "IPF.Task"
- supported_item_models = (Task,)
+ supported_item_models = TASK_ITEM_CLASSES
LOCALIZED_NAMES = {
"da_DK": ("Opgaver",),
"de_DE": ("Aufgaben",),
@@ -8415,8 +8600,8 @@ Inherited members
Expand source code
class ToDoSearch(WellknownFolder):
- CONTAINER_CLASS = "IPF.Task"
DISTINGUISHED_FOLDER_ID = "todosearch"
+ CONTAINER_CLASS = "IPF.Task"
supported_from = EXCHANGE_2013
LOCALIZED_NAMES = {
None: ("To-Do Search",),
@@ -8501,8 +8686,9 @@ Inherited members
Expand source code
class UserCuratedContacts(WellknownFolder):
+ DISTINGUISHED_FOLDER_ID = "usercuratedcontacts"
CONTAINER_CLASS = "IPF.Note"
- DISTINGUISHED_FOLDER_ID = "usercuratedcontacts"
+ supported_from = EXCHANGE_O365
Ancestors
@@ -8525,6 +8711,10 @@ Class variables
-
+var supported_from
+-
+
+
Inherited members
@@ -8754,11 +8944,14 @@ Subclasses
- DeletedItems
- Directory
- DlpPolicyEvaluation
+- Drafts
- Favorites
- FromFavoriteSenders
- IMContactList
+- Inbox
- Inference
- Journal
+- JunkEmail
- LocalFailures
- Messages
- MsgFolderRoot
@@ -8937,6 +9130,7 @@
CONTAINER_CLASS
DISTINGUISHED_FOLDER_ID
+supported_from
-
@@ -8964,8 +9158,6 @@
AllTodoTasks
@@ -9054,6 +9246,12 @@ CalendarSearchCache
+
+
+-
CommonViews
-
Drafts
-
@@ -9160,8 +9361,6 @@
ExternalContacts
@@ -9240,8 +9439,10 @@ Inbox
-
@@ -9260,8 +9461,10 @@
JunkEmail
-
@@ -9324,6 +9527,7 @@
OneNotePagePreviews
-
@@ -9376,39 +9580,51 @@
PersonMetadata
+
+
+-
QedcDefaultRetention
-
QedcLongRetention
-
QedcMediumRetention
-
QedcShortRetention
-
QuarantinedEmail
-
QuarantinedEmailDefaultCategory
-
@@ -9431,7 +9647,6 @@
CONTAINER_CLASS
DISTINGUISHED_FOLDER_ID
-LOCALIZED_NAMES
supported_from
@@ -9482,7 +9697,6 @@
CONTAINER_CLASS
DISTINGUISHED_FOLDER_ID
-LOCALIZED_NAMES
ShortNotes
CONTAINER_CLASS
DISTINGUISHED_FOLDER_ID
+supported_from
exchangelib
from .account import Account, Identity
from .attachments import FileAttachment, ItemAttachment
from .autodiscover import discover
-from .configuration import Configuration
+from .configuration import Configuration, O365InteractiveConfiguration
from .credentials import (
DELEGATE,
IMPERSONATION,
@@ -64,10 +64,9 @@ Package exchangelib
from .transport import BASIC, CBA, DIGEST, GSSAPI, NTLM, OAUTH2, SSPI
from .version import Build, Version
-__version__ = "5.3.0"
+__version__ = "5.4.0"
__all__ = [
- "__version__",
"AcceptItem",
"Account",
"Attendee",
@@ -107,6 +106,7 @@ Package exchangelib
"Message",
"NTLM",
"NoVerifyHTTPAdapter",
+ "O365InteractiveConfiguration",
"OAUTH2",
"OAuth2AuthorizationCodeCredentials",
"OAuth2Credentials",
@@ -129,6 +129,7 @@ Package exchangelib
"UTC",
"UTC_NOW",
"Version",
+ "__version__",
"close_connections",
"discover",
]
@@ -4914,6 +4915,10 @@ Inherited members
)
return f"{self.__class__.__name__}({args_str})"
+var credentials
string -> datetime from datetime.isoformat() output
string -> datetime from a string in most ISO 8601 formats
+class O365InteractiveConfiguration
+(client_id, username)
+
Contains information needed to create an authenticated connection to an EWS endpoint.
+The 'credentials' argument contains the credentials needed to authenticate with the server. Multiple credentials +implementations are available in 'exchangelib.credentials'.
+config = Configuration(credentials=Credentials('john@example.com', 'MY_SECRET'), …)
+The 'server' and 'service_endpoint' arguments are mutually exclusive. The former must contain only a domain name, +the latter a full URL:
+config = Configuration(server='example.com', ...)
+config = Configuration(service_endpoint='https://mail.example.com/EWS/Exchange.asmx', ...)
+
+If you know which authentication type the server uses, you add that as a hint in 'auth_type'. Likewise, you can +add the server version as a hint. This allows to skip the auth type and version guessing routines:
+config = Configuration(auth_type=NTLM, ...)
+config = Configuration(version=Version(build=Build(15, 1, 2, 3)), ...)
+
+You can use 'retry_policy' to define a custom retry policy for handling server connection failures:
+config = Configuration(retry_policy=FaultTolerance(max_wait=3600), ...)
+
+'max_connections' defines the max number of connections allowed for this server. This may be restricted by +policies on the Exchange server.
class O365InteractiveConfiguration(Configuration):
+ SERVER = "outlook.office365.com"
+
+ def __init__(self, client_id, username):
+ credentials = O365InteractiveCredentials(client_id=client_id, username=username)
+ super().__init__(server=self.SERVER, auth_type=OAUTH2, credentials=credentials)
+var SERVER
class OAuth2AuthorizationCodeCredentials
(authorization_code=None, **kwargs)
@@ -9993,6 +10053,10 @@ Ancestors
BaseOAuth2Credentials
BaseCredentials
+Subclasses
+
Inherited members
BaseOAuth2Credentials
:
@@ -13715,6 +13779,12 @@ O365InteractiveConfiguration
+
+SERVER
+
+
+-
OAuth2AuthorizationCodeCredentials
-
diff --git a/docs/exchangelib/items/index.html b/docs/exchangelib/items/index.html
index bed3b10f..950df36d 100644
--- a/docs/exchangelib/items/index.html
+++ b/docs/exchangelib/items/index.html
@@ -104,68 +104,74 @@
Module exchangelib.items
PostItem,
Task,
)
+TASK_ITEM_CLASSES = (Task,)
+CONTACT_ITEM_CLASSES = (Contact, DistributionList)
+MESSAGE_ITEM_CLASSES = (Message, MeetingRequest, MeetingResponse, MeetingCancellation)
__all__ = [
- "RegisterMixIn",
- "MESSAGE_DISPOSITION_CHOICES",
- "SAVE_ONLY",
- "SEND_ONLY",
- "SEND_AND_SAVE_COPY",
- "CalendarItem",
- "AcceptItem",
- "TentativelyAcceptItem",
- "DeclineItem",
- "CancelCalendarItem",
- "MeetingRequest",
- "MeetingResponse",
- "MeetingCancellation",
- "CONFERENCE_TYPES",
- "Contact",
- "Persona",
- "DistributionList",
- "SEND_MEETING_INVITATIONS_CHOICES",
- "SEND_TO_NONE",
- "SEND_ONLY_TO_ALL",
- "SEND_TO_ALL_AND_SAVE_COPY",
- "SEND_MEETING_INVITATIONS_AND_CANCELLATIONS_CHOICES",
- "SEND_ONLY_TO_CHANGED",
- "SEND_TO_CHANGED_AND_SAVE_COPY",
- "SEND_MEETING_CANCELLATIONS_CHOICES",
+ "ACTIVE_DIRECTORY",
+ "ACTIVE_DIRECTORY_CONTACTS",
"AFFECTED_TASK_OCCURRENCES_CHOICES",
"ALL_OCCURRENCES",
- "SPECIFIED_OCCURRENCE_ONLY",
- "CONFLICT_RESOLUTION_CHOICES",
- "NEVER_OVERWRITE",
- "AUTO_RESOLVE",
+ "ALL_PROPERTIES",
"ALWAYS_OVERWRITE",
+ "ASSOCIATED",
+ "AUTO_RESOLVE",
+ "AcceptItem",
+ "BaseItem",
+ "BulkCreateResult",
+ "CONFERENCE_TYPES",
+ "CONFLICT_RESOLUTION_CHOICES",
+ "CONTACT_ITEM_CLASSES",
+ "CONTACTS",
+ "CONTACTS_ACTIVE_DIRECTORY",
+ "CalendarItem",
+ "CancelCalendarItem",
+ "Contact",
+ "DEFAULT",
"DELETE_TYPE_CHOICES",
+ "DeclineItem",
+ "DistributionList",
+ "ForwardItem",
"HARD_DELETE",
- "SOFT_DELETE",
- "MOVE_TO_DELETED_ITEMS",
- "BaseItem",
+ "ID_ONLY",
+ "ITEM_CLASSES",
+ "ITEM_TRAVERSAL_CHOICES",
"Item",
- "BulkCreateResult",
+ "MESSAGE_DISPOSITION_CHOICES",
+ "MESSAGE_ITEM_CLASSES",
+ "MOVE_TO_DELETED_ITEMS",
+ "TASK_ITEM_CLASSES",
+ "MeetingCancellation",
+ "MeetingRequest",
+ "MeetingResponse",
"Message",
- "ReplyToItem",
- "ReplyAllToItem",
- "ForwardItem",
+ "NEVER_OVERWRITE",
+ "Persona",
"PostItem",
"PostReplyItem",
- "Task",
- "ITEM_TRAVERSAL_CHOICES",
+ "RegisterMixIn",
+ "ReplyAllToItem",
+ "ReplyToItem",
+ "SAVE_ONLY",
+ "SEARCH_SCOPE_CHOICES",
+ "SEND_AND_SAVE_COPY",
+ "SEND_MEETING_CANCELLATIONS_CHOICES",
+ "SEND_MEETING_INVITATIONS_AND_CANCELLATIONS_CHOICES",
+ "SEND_MEETING_INVITATIONS_CHOICES",
+ "SEND_ONLY",
+ "SEND_ONLY_TO_ALL",
+ "SEND_ONLY_TO_CHANGED",
+ "SEND_TO_ALL_AND_SAVE_COPY",
+ "SEND_TO_CHANGED_AND_SAVE_COPY",
+ "SEND_TO_NONE",
"SHALLOW",
- "SOFT_DELETED",
- "ASSOCIATED",
"SHAPE_CHOICES",
- "ID_ONLY",
- "DEFAULT",
- "ALL_PROPERTIES",
- "SEARCH_SCOPE_CHOICES",
- "ACTIVE_DIRECTORY",
- "ACTIVE_DIRECTORY_CONTACTS",
- "CONTACTS",
- "CONTACTS_ACTIVE_DIRECTORY",
- "ITEM_CLASSES",
+ "SOFT_DELETE",
+ "SOFT_DELETED",
+ "SPECIFIED_OCCURRENCE_ONLY",
+ "Task",
+ "TentativelyAcceptItem",
]
diff --git a/docs/exchangelib/properties.html b/docs/exchangelib/properties.html
index 97ded4ff..7bab2a1f 100644
--- a/docs/exchangelib/properties.html
+++ b/docs/exchangelib/properties.html
@@ -2330,8 +2330,13 @@ exchangelib.properties
def delete(self):
if self.is_enabled is False:
- # Cannot delete a disabled rule - server throws 'ErrorItemNotFound'
+ # Cannot delete a disabled rule - the server throws 'ErrorItemNotFound'. We need to enable it first.
self.is_enabled = True
+ # Make sure we can save the rule by wiping all possibly-misconfigured fields
+ self.priority = 10**6
+ self.conditions = None
+ self.exceptions = None
+ self.actions = Actions(stop_processing_rules=True)
self.save()
self.account.delete_rule(self)
diff --git a/docs/exchangelib/services/common.html b/docs/exchangelib/services/common.html
index 1d22fc85..b9ed6056 100644
--- a/docs/exchangelib/services/common.html
+++ b/docs/exchangelib/services/common.html
@@ -999,10 +999,15 @@ exchangelib.services.common
def parse_folder_elem(elem, folder):
if isinstance(folder, RootOfHierarchy):
- return folder.from_xml(elem=elem, account=folder.account)
- if isinstance(folder, Folder):
- return folder.from_xml_with_root(elem=elem, root=folder.root)
- raise ValueError(f"Unsupported folder class: {folder}")
+ res = folder.from_xml(elem=elem, account=folder.account)
+ elif isinstance(folder, Folder):
+ res = folder.from_xml_with_root(elem=elem, root=folder.root)
+ else:
+ raise ValueError(f"Unsupported folder class: {folder}")
+ # Not all servers support fetching the DistinguishedFolderId field. Add it back here.
+ if folder._distinguished_id and not res._distinguished_id:
+ res._distinguished_id = folder._distinguished_id
+ return res
diff --git a/docs/exchangelib/services/index.html b/docs/exchangelib/services/index.html
index 7d9aa443..b2779535 100644
--- a/docs/exchangelib/services/index.html
+++ b/docs/exchangelib/services/index.html
@@ -97,14 +97,16 @@ Module exchangelib.services
"CopyItem",
"CreateAttachment",
"CreateFolder",
+ "CreateInboxRule",
"CreateItem",
"CreateUserConfiguration",
"DeleteAttachment",
"DeleteFolder",
- "DeleteUserConfiguration",
+ "DeleteInboxRule",
"DeleteItem",
- "EmptyFolder",
+ "DeleteUserConfiguration",
"EWSService",
+ "EmptyFolder",
"ExpandDL",
"ExportItems",
"FindFolder",
@@ -114,6 +116,7 @@ Module exchangelib.services
"GetDelegate",
"GetEvents",
"GetFolder",
+ "GetInboxRules",
"GetItem",
"GetMailTips",
"GetPersona",
@@ -132,6 +135,7 @@ Module exchangelib.services
"ResolveNames",
"SendItem",
"SendNotification",
+ "SetInboxRule",
"SetUserOofSettings",
"SubscribeToPull",
"SubscribeToPush",
@@ -143,10 +147,6 @@ Module exchangelib.services
"UpdateItem",
"UpdateUserConfiguration",
"UploadItems",
- "GetInboxRules",
- "CreateInboxRule",
- "SetInboxRule",
- "DeleteInboxRule",
]