mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-09 16:25:33 +01:00
first implementation of the mail rework
This commit is contained in:
parent
011bc9916e
commit
0b1637da62
25 changed files with 421 additions and 8665 deletions
18
src/paperless_mail/tasks.py
Normal file
18
src/paperless_mail/tasks.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import logging
|
||||
|
||||
from paperless_mail import mail
|
||||
from paperless_mail.models import MailAccount
|
||||
|
||||
|
||||
def process_mail_accounts():
|
||||
for account in MailAccount.objects.all():
|
||||
mail.handle_mail_account(account)
|
||||
|
||||
|
||||
def process_mail_account(name):
|
||||
account = MailAccount.objects.find(name=name)
|
||||
if account:
|
||||
mail.handle_mail_account(account)
|
||||
else:
|
||||
logging.error("Unknown mail acccount: {}".format(name))
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue