Skip to main content

Inbox event listener for exchangelib

This library listens for events in the inbox and raises an event.

Usage

Create listener:

from exchangelib import DELEGATE, Account, Credentials, Configuration
from exchangelib.properties import NewMailEvent, MovedEvent
from exchangelib_listener import Listener

creds = Credentials(
    username='EMAIL_ADDRESS',
    password='PASSWORD'
)
config = Configuration(
    server='SERVER',
    credentials=creds
)
acct = Account(
    primary_smtp_address='EMAIL_ADDRESS',
    config=config,
    access_type=DELEGATE
)

listener = Listener(acct)

Create a method to call when events are raised:

def events_received(events):
    for event in events:
        if isinstance(event, NewMailEvent):
            # Do something
        elif isinstance(event, MovedEvent):
            # Do something

listener.streaming_events_received += events_received
listener.listen()

Or receive a single event:

def new_messaged_received():
    # Do something

listener.streaming_event_received += new_messaged_received
listener.listen(NewMailEvent)

Release files for exchangelib-listener 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for exchangelib-listener 1.1.1
File Size Uploaded
exchangelib_listener-1.1.1.tar.gz 2.4 kB Details

Release files / exchangelib_listener-1.1.1.tar.gz

Download URL exchangelib_listener-1.1.1.tar.gz
Size 2.4 kB
Tags Source
SHA-256 checksum
How to use checksums
31044b246b7a7e27981bd1b109171825beec3d8c21d4f39048ab139ef3928128
BLAKE2b-256 checksum
How to use checksums
46b28d16613cf55a5441aa1d7a294fbf632ccfae45044acdaad1b0c9e7048807
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.6

Release history Release notifications | RSS feed

This release

1.1.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page