From 0515cf7f7495f3297f6c34515da7dfba381001f4 Mon Sep 17 00:00:00 2001 From: "me@adamcoddington.net" Date: Mon, 8 Oct 2012 15:28:37 +0000 Subject: [PATCH] Do not attempt to fetch mail for mailbox not having a URI. --HG-- branch : exim4_pipe --- django_mailbox/management/commands/getmail.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/django_mailbox/management/commands/getmail.py b/django_mailbox/management/commands/getmail.py index 5f1aad3..e74f683 100644 --- a/django_mailbox/management/commands/getmail.py +++ b/django_mailbox/management/commands/getmail.py @@ -8,6 +8,8 @@ class Command(BaseCommand): if args: mailboxes = mailboxes.filter(name = ' '.join(args)) for mailbox in mailboxes: + if not mailbox.uri: + continue self.stdout.write('Gathering messages for %s\n' % mailbox.name) messages = mailbox.get_new_mail() for message in messages: