Werk #11208: check_mailboxes: Handle invalid mailbox names
Komponente | Checks & agents |
Titel | check_mailboxes: Handle invalid mailbox names |
Datum | 24.09.2020 |
Checkmk Edition | Checkmk Raw (CRE) |
Checkmk-Version | 2.0.0i1 |
Level | Kleine Änderung |
Klasse | Bugfix |
Kompatibilität | Kompatibel - benötigt kein manuelles Eingreifen |
A space character in a mailbox name provided via --mailbox=<NAME>
, e.g. "My Inbox"
would lead to a known exception:
imaplib.IMAP4.error: SELECT command error: BAD [b"parse error: wrong character; expected '(' but got 'I'"]
see https://bugs.python.org/issue13940
This fix quotes mailbox names and thus fixes the described behaviour.
Also, provided mailbox names which do not exist on the server would have been ignored silently. This fix will render the check UNKNOWN in case any non-existent names are encountered.