checkmk icon indicating copy to clipboard operation
checkmk copied to clipboard

don't discard all mails if mail_id's are bytes instead of str

Open gradecke opened this issue 2 years ago • 0 comments

Depending on the mailserver + python version, the mail_id can be bytes instead of str. i.e. in 2.1 with the older Python 3, out onprem exchange response was parsed to str, in 2.2 it is parsed to bytes and hence all mail_ids were discarded here and check_mailbox always pretended no old mails were found and the check was essentially functionless. However, fetch_timestamp can totally handle mail_id's in bytes format, so we can just pass those as well in the next line :)

Thank you for your interest in contributing to Checkmk! Consider looking into Readme regarding process details.

General information

Please give a brief summary of the affected device, software or appliance. Keep in mind that we are experts in monitoring, but we cannot be experts on all supported devices. A little context will help us assess your proposed change.

Bug reports

Please include:

  • Centos 7,
  • Checkmk 2.2

active check_mailbox checks kept return only "OK" when looking for old e-mails as no mail timestamps could be retrieved. The same code worked in 2.1, there was no change on the Exchange IMAP server side.

Proposed changes

simply pass bytes to fetch_timestamp, the function is able to handle it and anyhow :)

gradecke avatar Oct 25 '23 19:10 gradecke