Fix matches count

This commit is contained in:
Antonio J. Delgado 2024-09-06 14:36:00 +03:00
parent ebbe85dd3d
commit 73edeb120d

View file

@ -74,7 +74,7 @@ class ImapFilter:
mailbox['mailbox']
)
msg_count = 0
mailbox_matches = 0
self.mailbox_matches = 0
for message_id in all_msgs_uids:
msg_count += 1
self._log.debug(
@ -100,16 +100,16 @@ class ImapFilter:
"Error fetching message. %s",
error
)
if mailbox_matches > 0:
if self.mailbox_matches > 0:
self._log.info(
"A total of %s matches for this mailbox,",
mailbox_matches
self.mailbox_matches
)
else:
self._log.info(
"No matches for this mailbox"
)
matches += mailbox_matches
matches += self.mailbox_matches
self._log.info(
"A total of %s matches for all mailboxes.",
matches
@ -158,7 +158,7 @@ class ImapFilter:
field_data,
mfilter['name']
)
mailbox_matches += 1
self.mailbox_matches += 1
if self.config['dummy']:
self._log.info('Doing nothing (dummy run)')
else: