Check email delivery (mail loop) check broken in 2.1.0p36

CMK version: Checkmk Enterprise Edition 2.1.0p36
OS version: RHEL8

Hello,

We use the Check email delivery (mail loop) check and recently updated Checkmk from 2.1.0p25 to 2.1.0p36. Since the update the check seems broken.

Short story:
Having multiple of these checks work in the same mailbox doesn’t work anymore because each checks removes all received mails, and no longer just the one that matches the specific check.

Long story:
We have 4 ‘check email delivery’ checks configured, all 4 with the same mail box, which was never an issue since the check checks for received mails with a random 3-digit number in the subject, that is expected by the specific check.
Since we updated from 2.1.0p25 to 2.1.0p36, all four of our checks started to fail. When we disabled three of them, the other one worked without a problem.
One of my colleagues looked in the plugin python code and suspects the following part:

--- /opt/omd/versions/2.1.0p25.cee/lib/nagios/plugins/check_mail_loop   2023-03-22 17:35:57.000000000 +0100
+++ /opt/omd/versions/2.1.0p36.cee/lib/nagios/plugins/check_mail_loop   2023-10-30 12:03:09.000000000 +0100
[snip]
-            mailbox.delete_mails(
-                set(
-                    elem[0]
-                    for maillist in (obsolete_mails, fetched_mails)
-                    for elem in maillist.values()
-                )
-            )
+            mailbox.delete_mails(fetched_mail_messages)

As a workaround we now disabled the deletion of the mails, but forces us to manually empty the mailbox.

Kind regards,
Casper

Nobody is experiencing this issue?
We do not have a support contract, but we are using the Enterprise Edition.

It would be great if a Checkmk representative could at least comment that the change to the check_mail_loop (and it’s consequences) were intentional or not, and if the issue is being looked into or not.

Best regards,
Casper

Hello. Not sure if this can clarify the issue:

Noticed this ? check_mail and check_mail_loop: Enable EWS and OAuth2
and this :slight_smile: Deprecation of Basic authentication in Exchange Online | Microsoft Learn

Hello,

Thank you for your reply (and time) :slight_smile:

Yes, I’ve checked the “werks”, and it seems unrelated to our issue, because:
The check now removes all received mails, and no longer just the one(s) that match the specific check’s message (random 3-digit number in the subject).

Kind regards,
Casper

It is related to this thread from another user

We have opened an internal ticket on this. Its currently under iinvestigation.

2 Likes

Having exactly the same issue (version 2.2.0p20) and reverting that patch fixed it for me!

Its fixed here: check_mail_loop: if configured to delete processed mails, check_mail_loop would delete all mails instead

1 Like