mirror of
https://github.com/coddingtonbear/django-mailbox.git
synced 2026-07-10 06:48:19 +02:00
django-mailbox: support office365 oauth2
This commit is contained in:
parent
2932403417
commit
bc9eb6ab34
3 changed files with 68 additions and 1 deletions
|
|
@ -31,7 +31,7 @@ from django_mailbox import utils
|
|||
from django_mailbox.signals import message_received
|
||||
from django_mailbox.transports import Pop3Transport, ImapTransport, \
|
||||
MaildirTransport, MboxTransport, BabylTransport, MHTransport, \
|
||||
MMDFTransport, GmailImapTransport
|
||||
MMDFTransport, GmailImapTransport, Office365ImapTransport
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
@ -216,6 +216,14 @@ class Mailbox(models.Model):
|
|||
archive=self.archive
|
||||
)
|
||||
conn.connect(self.username, self.password)
|
||||
elif self.type == 'office365':
|
||||
conn = Office365ImapTransport(
|
||||
self.location,
|
||||
port=self.port if self.port else None,
|
||||
ssl=True,
|
||||
archive=self.archive
|
||||
)
|
||||
conn.connect(self.username, self.password)
|
||||
elif self.type == 'pop3':
|
||||
conn = Pop3Transport(
|
||||
self.location,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue