diff --git a/imap_filter/imap_filter.py b/imap_filter/imap_filter.py index bb176b6..c123663 100644 --- a/imap_filter/imap_filter.py +++ b/imap_filter/imap_filter.py @@ -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: