test for mailbox key

This commit is contained in:
Antonio J. Delgado 2024-12-29 11:42:07 +02:00
parent 3c3adda881
commit 77551fe8dc

View file

@ -66,6 +66,12 @@ class ImapFilter:
def _process_filters(self):
matches = 0
for mailbox in self.config['mailboxes']:
if 'mailbox' not in mailbox:
self._log.warning(
"No mailbox name in %s, skipping.",
mailbox
)
break
if mailbox['mailbox'] == 'INBOX' and self.config['sieve_scripts_path']:
self._create_sieve_script(mailbox['filters'])
self._log.debug(
@ -220,6 +226,7 @@ class ImapFilter:
mfilter['name'],
mfilter
)
return {"match": False}
match = re.match(regexp, field_data)
if match:
self._log.info(