I am trying to retrieve email addresses of a DL in Exchange 2010. I tried code from this url and am getting an error.
https://github.com/ecederstrand/exchangelib
# primary_smtp_address: what should be provided here?
# cred: do we need to provide admin users to retrieve data?
from exchangelib import DELEGATE, Account, Credentials, Configuration
cred = Credentials(username='domain\username',password='xxxx')
config = Configuration(server='exchangeserver.com', credentials=cred)
account = Account(primary_smtp_address='def@xyz.com', config=config, autodiscover=False, access_type=DELEGATE)
for mailbox in account.protocol.epxand_dl('abc@xyz.com'):
print(mailbox.email_address)
Instead of result am getting below error.
Traceback (most recent call last): File "E:\Sheik-Backup\Sheik-Backup\Workspace\FlaskProject\maillist.py", line 11, in a=Account(...) File "E:\Python Virtual-Env\Development\lib\site-packages\exchangelib\account.py", line 57, in init if '@' not in primary_smtp_address: TypeError: argument of type 'ellipsis' is not iterable