Questions tagged [exchangelib]

exchangelib is a Python package which provides an interface for communicating with a Microsoft Exchange 2007-2016 Server or Office365 using Exchange Web Services (EWS).

See also

235 questions
1
vote
0 answers

Why does exchangelib not work on pythonanywhere?

I've used the exchangelib package for years, but it does not seem to work on pythonanywhere. I run the identical script on my local mac (which runs predictably well and normally) but on PA the stdout trace output says my creds are wrong, eventhough…
1
vote
1 answer

How to get the original recipient of a MeetingRequest using Python exchangelib?

The scenario In our scenario we have: a manager mailbox (manager@xxx.yyy) many resource mailboxes (resource_a@xxx.yyy, resource_b@xxx.yyy...) Resource mailboxes are setup so that their meeting requests are forwarded to the manager mailbox. The…
Boodbarbak
  • 13
  • 3
1
vote
1 answer

Parsing XML returned by SendNotification in exchangelib

I'm working on a python project to process emails as they arrive in a Microsoft inbox. Specifically, I want to set up a push subscription, receive notifications when a new email hits the inbox, and then construct and send another email based on the…
1
vote
1 answer

Get email_address's from item.cc_recipients exchangelib

I think I'm stuck looking for an efficient solution print(item.cc_recipients) I got the result: [Mailbox(name='xxx1@gmail.com', email_address='xxx1@gmail.com', routing_type='SMTP', mailbox_type='OneOff', item_id=None), Mailbox(name='xxxx xxxx',…
aliciavika
  • 87
  • 8
1
vote
1 answer

How is it possible to filter on `author` or `sender` using Python exchangelib v 4.5.1?

Using exchangelib's django-like syntax, I can successfully filter() on a message's subject field: my_account.inbox.filter(subject__contains="foo") But I've found no way to do (and no examples of) a filter() on sender or author. Since author (for…
d5ous
  • 11
  • 1
1
vote
1 answer

Changing timezone from EWS datetime_received from standard to +2

I'm trying to change the timezone from UTC+0 to GMT+2. I have tried a lot but i just can't figure it out any help would be amazing credentials = Credentials(email, wachtwoord) acc = Account(email, credentials=credentials, autodiscover=True) for…
Minimumspace
  • 341
  • 2
  • 21
1
vote
1 answer

Problem when requesting data from the calendar using exchangelib

I'm trying to read a fairly large calendar using almost unchanged code from the official documentation. from exchangelib import DELEGATE, Account, Credentials, CalendarItem, close_connections from exchangelib.protocol import BaseProtocol credentials…
1
vote
1 answer

How to speed up the process of converting QuerySet object into JSON array in Python

I am using exchangelib to fetch emails. My function retrieves nearly 150000 emails(output is of type query set) in a second. I have to convert query set into JSON array for processing it further. Right now it is taking about an hour to convert…
1
vote
2 answers

Speeding up fetching emails using Exchangelib

Currently I fetch emails using an iterator this way: for item in account.inbox.filter(datetime_received__gt=__LAST_ANALYSYS__+timedelta(0,1)): I also test if type(item) == Message: as another filter layer. Issue: it takes 5-10 mins to fetch 400+…
1
vote
1 answer

How to get the parent folder name of Message with Exchangelib python

I have an Item object obtained by filtering on an account using exchangelib in python 3.7. It is an email object. I need to find the parent folder name of this item. I specifically need the name field of the folder(This is for tracking where…
Axxelerated
  • 161
  • 7
1
vote
1 answer

How to filter by email_address domain with exchangelib?

I'm having the following problem to get the emails. Also, I want to filter emails by email_address domain. Code: from exchangelib import Q from exchangelib import Account, Configuration, Credentials, DELEGATE, errors ... account =…
EEEEH
  • 759
  • 1
  • 7
  • 28
1
vote
1 answer

Invalid Credentials error when connecting to Exchange Web Service

I am trying to connect to the Exchange Web Service to get access to Outlook and Teams data using Exchangelib library in Python. I am following the below article, https://github.com/ecederstrand/exchangelib/issues/747 Below is the code snippet, from…
1
vote
0 answers

exchangelib not work with some subject filters

I am having the following problem to get the unread emails. When the subject is "REALIZADAS" it works fine and brings me the emails quickly, but when the subject is "G.09.xlsx" it takes a long time and fails to deliver this error 'An existing…
Danilo Toro
  • 569
  • 2
  • 15
1
vote
1 answer

Python exchangelib - How to Capture/Save email as png

Need your assistance in saving the email as .png. The code below will get the body of the email, but it is unable to get a screenshot in the body of the email. with open(r"output.txt", "w") as output: for item in…
Nithin S
  • 13
  • 3
1
vote
1 answer

Exchangelib error in Python: www-authenticate

I'm randomly facing an authentication error using library exchangelib: from exchangelib import DELEGATE, Account, Credentials creds = Credentials( username=username, password=pw) account = Account( primary_smtp_address=mailbox_mail, …
walzer91
  • 509
  • 1
  • 8
  • 22