forked from mirror/django-mailbox
Add pluggable transport registry
This commit is contained in:
parent
201f568750
commit
6ded51bcde
4 changed files with 18 additions and 2 deletions
|
|
@ -35,6 +35,7 @@ from django_mailbox.signals import message_received
|
|||
from django_mailbox.transports import Pop3Transport, ImapTransport, \
|
||||
MaildirTransport, MboxTransport, BabylTransport, MHTransport, \
|
||||
MMDFTransport, GmailImapTransport
|
||||
from django_mailbox.transports.registry import transport_registry
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
@ -223,7 +224,7 @@ class Mailbox(models.Model):
|
|||
conn = MHTransport(self.location)
|
||||
elif self.type == 'mmdf':
|
||||
conn = MMDFTransport(self.location)
|
||||
return conn
|
||||
return transport_registry[self.type].from_url(self.uri)
|
||||
|
||||
def process_incoming_message(self, message):
|
||||
"""Process a message incoming to this mailbox."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue