From b7192e914951ba7b40d36488d09b664e13b519e2 Mon Sep 17 00:00:00 2001 From: Adam Coddington Date: Sun, 7 Oct 2012 19:43:38 -0700 Subject: [PATCH] Model modifications for allowing empty source inputs; adding processincomingmessage management command. --HG-- branch : exim4_pipe --- .../management/commands/processincomingmessage.py | 14 ++++++++++++++ django_mailbox/models.py | 4 +++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 django_mailbox/management/commands/processincomingmessage.py diff --git a/django_mailbox/management/commands/processincomingmessage.py b/django_mailbox/management/commands/processincomingmessage.py new file mode 100644 index 0000000..15d8b7b --- /dev/null +++ b/django_mailbox/management/commands/processincomingmessage.py @@ -0,0 +1,14 @@ +import email +import ipdb +import sys + +from django.core.managemet.base import BaseCommand + +from django_mailbox.models import Mailbox, Message + +class Command(BaseCommand): + def handle(self, *args, **options): + message_string = open(sys.stdin, 'r').read() + ipdb.set_trace() + #message = email.message_from_string(message_string) + diff --git a/django_mailbox/models.py b/django_mailbox/models.py index 50ea5d8..f293850 100755 --- a/django_mailbox/models.py +++ b/django_mailbox/models.py @@ -22,7 +22,9 @@ class Mailbox(models.Model):
Be sure to urlencode your username and password should they contain illegal characters (like @, :, etc). - """ + """, + blank=True, + default=None, ) @property