1
0
Fork 1
mirror of https://github.com/coddingtonbear/django-mailbox.git synced 2026-07-09 22:38:19 +02:00

add imaps STARTTLS support (#94)

* add imaps STARTTLS support using +tls

* documentation on STARTTLS
This commit is contained in:
Steeve 2016-05-15 21:05:11 +02:00 committed by Adam Coddington
parent 0f990a44d5
commit 8a73076427
3 changed files with 18 additions and 7 deletions

View file

@ -144,6 +144,11 @@ class Mailbox(models.Model):
"""Returns whether or not this mailbox's connection uses SSL."""
return '+ssl' in self._protocol_info.scheme.lower()
@property
def use_tls(self):
"""Returns whether or not this mailbox's connection uses STARTTLS."""
return '+tls' in self._protocol_info.scheme.lower()
@property
def archive(self):
"""Returns (if specified) the folder to archive messages to."""
@ -174,6 +179,7 @@ class Mailbox(models.Model):
self.location,
port=self.port if self.port else None,
ssl=self.use_ssl,
tls=self.use_tls,
archive=self.archive,
folder=self.folder
)