1
0
Fork 1
mirror of https://github.com/coddingtonbear/django-mailbox.git synced 2026-07-10 06:48:19 +02:00

Added explicit getmail command arguments to parse one or more mailbox names and added maximum email read count

This commit is contained in:
MSI Shafik 2023-05-18 10:24:43 +06:00
parent 462fdd3e49
commit 221585a254
3 changed files with 19 additions and 10 deletions

View file

@ -6,6 +6,11 @@ from django_mailbox.models import Mailbox
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('-mb', '--mailboxes', type=str, nargs='+', help='Write mailbox names')
parser.add_argument('-mr', '--max_read', type=int,
help='Write maximum number of email to read from each mailbox')
def handle(self, *args, **options):
logging.basicConfig(level=logging.INFO)
Mailbox.get_new_mail_all_mailboxes(args)
Mailbox.get_new_mail_all_mailboxes(options)