From e1851d026acc854df2e7e4a2f497d02ce998ad7a Mon Sep 17 00:00:00 2001 From: mihugo Date: Thu, 26 Mar 2026 10:04:27 -0700 Subject: [PATCH] Fix current_time format for MSGraphConnection (#708) Should have caught this on previous fix for since. the current time is used on line 2145: connection.fetch_messages(reports_folder, since=current_time) if that code is called and it usually won't be depending upon configuration it will fail with the time format being wrong: yyyy-mm-ddThh:mm:ss.zzzzzz+00:00Z --- this removes the extra "Z" that is not needed since utc offset is already specified and becomes invalid. --- parsedmarc/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parsedmarc/__init__.py b/parsedmarc/__init__.py index e36113f..b184f75 100644 --- a/parsedmarc/__init__.py +++ b/parsedmarc/__init__.py @@ -1956,7 +1956,7 @@ def get_dmarc_reports_from_mailbox( current_time = datetime.now(timezone.utc).strftime("%d-%b-%Y") elif isinstance(connection, MSGraphConnection): since = (datetime.now(timezone.utc) - timedelta(minutes=_since)).isoformat() - current_time = datetime.now(timezone.utc).isoformat() + "Z" + current_time = datetime.now(timezone.utc).isoformat() elif isinstance(connection, GmailConnection): since = (datetime.now(timezone.utc) - timedelta(minutes=_since)).strftime( "%s"