mailbot doesn't crawl mails which it wrote itself anymore
This commit is contained in:
parent
72d0acb20a
commit
ee61ba19e6
|
@ -84,6 +84,8 @@ class Mailbot(object):
|
||||||
return msgs
|
return msgs
|
||||||
msg = email.message_from_bytes(data[0][1])
|
msg = email.message_from_bytes(data[0][1])
|
||||||
|
|
||||||
|
if not self.config['mail']['user'] + "@" + \
|
||||||
|
self.config["mail"]["mailserver"].partition(".")[2] in msg['From']:
|
||||||
# get a comparable date out of the email
|
# get a comparable date out of the email
|
||||||
date_tuple = email.utils.parsedate_tz(msg['Date'])
|
date_tuple = email.utils.parsedate_tz(msg['Date'])
|
||||||
date_tuple = datetime.datetime.fromtimestamp(email.utils.mktime_tz(date_tuple))
|
date_tuple = datetime.datetime.fromtimestamp(email.utils.mktime_tz(date_tuple))
|
||||||
|
@ -154,7 +156,8 @@ class Mailbot(object):
|
||||||
:param statuses: (list of report.Report objects)
|
:param statuses: (list of report.Report objects)
|
||||||
:return: statuses: (list of report.Report objects)
|
:return: statuses: (list of report.Report objects)
|
||||||
"""
|
"""
|
||||||
self.post(statuses)
|
for status in statuses:
|
||||||
|
self.post(status)
|
||||||
|
|
||||||
msgs = self.crawl()
|
msgs = self.crawl()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue