forked from ticketfrei/ticketfrei
fixing shutdown when exim4 is not set up
This commit is contained in:
parent
6d94c1b540
commit
3590aa67a3
|
@ -19,7 +19,11 @@ class Mailbot(Bot):
|
|||
def crawl(self, user):
|
||||
reports = []
|
||||
# todo: adjust to actual mailbox
|
||||
mails = mailbox.mbox("/var/mail/" + config['mail']['mbox_user'])
|
||||
try:
|
||||
mails = mailbox.mbox("/var/mail/" + config['mail']['mbox_user'])
|
||||
except FileNotFoundError:
|
||||
logger.error("No mbox file found.", exc_info=True)
|
||||
return reports
|
||||
for msg in mails:
|
||||
if get_date_from_header(msg['Date']) > user.get_seen_mail():
|
||||
if user.get_city().lower() in msg['To'].lower():
|
||||
|
|
Loading…
Reference in a new issue