Ignore public folders, fixed error message in logs

This commit is contained in:
Christoph Haas 2017-05-07 00:40:45 +02:00
parent 1ab70fbf1e
commit 5903684dda
1 changed files with 5 additions and 4 deletions

View File

@ -49,10 +49,11 @@ class Checker(object):
if item.message_class == 'IPM.Note': if item.message_class == 'IPM.Note':
spamstatus = item.header(self.spamheader) spamstatus = item.header(self.spamheader)
if spamstatus is not None: if spamstatus is not None:
if item.folder == item.store.user.junk and not spamstatus.lower().startswith('yes'): if item.store.user: # skip public stores
self.learn(item) if item.folder == item.store.user.junk and not spamstatus.lower().startswith('yes'):
if item.folder == item.store.user.inbox and spamstatus.lower().startswith('yes'): self.learn(item)
self.unlearn(item) if item.folder == item.store.user.inbox and spamstatus.lower().startswith('yes'):
self.unlearn(item)
def learn(self, item): def learn(self, item):
with log_exc(self.log): with log_exc(self.log):