mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
19 lines
430 B
Python
19 lines
430 B
Python
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))
|
|
|