Skip to content

[Bug]: MSGrap ClientSecret RuntimeError: Event loop is closed #742

@tiborjan

Description

@tiborjan

parsedmarc version

9.11.0

Input backend

MS Graph

Environment

Parsedmarc Graph mailbox fetch fails in mailsuite.mailbox.graph.GraphMailbox.fetch_messages()
RuntimeError: Event loop is closed
Python: 3.12.8 and 3.13
OS: Debian 13 trixie
Failure point: mail_folders.by_mail_folder_id(folder_id).messages.get()

I observed the script creates the Archive/Aggregate subfolder then it fails. No other subfolders created.

Sanitized config

[general]
save_aggregate = False
save_forensic = False

[mailbox]
watch = True
delete = False
reports_folder = Inbox
batch_size = 100

[msgraph]
## access via MS graph API. Can only read content of declared shared mailbox.
enabled = True
mailbox = dmarc@mydomain.com
auth_method = ClientSecret
tenant_id = 4.....
client_id = c.....
client_secret = 0....

[splunk_hec]
url = https://x.x.x.x:8088/
token = ey.......>
index = dmarc
skip_certificate_verification = True

Steps to reproduce

  1. Created the mailbox, mail enabled security group and app registration with Mail.Readwrite application permission which is granted.
  2. Installed parsedmarc with pip (tried with different python versions.)
  3. Used the provided .ini file
  4. run parsedmarc -c parsedmark.ini --debug

Expected vs actual behavior

I have no trace what is actually failing, in the error output there is no difference with --debug or --verbose.

Logs or traceback


Sample report availability

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions