mirror of
https://github.com/coddingtonbear/django-mailbox.git
synced 2026-07-10 06:48:19 +02:00
Added email archiving option to IMAP transport
This commit is contained in:
parent
872f4786c7
commit
0e0c6cf170
4 changed files with 49 additions and 14 deletions
|
|
@ -146,6 +146,10 @@ class Mailbox(models.Model):
|
|||
def use_ssl(self):
|
||||
return '+ssl' in self._protocol_info.scheme.lower()
|
||||
|
||||
@property
|
||||
def archive(self):
|
||||
return self._protocol_info.query
|
||||
|
||||
def get_connection(self):
|
||||
if not self.uri:
|
||||
return None
|
||||
|
|
@ -153,7 +157,8 @@ class Mailbox(models.Model):
|
|||
conn = ImapTransport(
|
||||
self.location,
|
||||
port=self.port if self.port else None,
|
||||
ssl=self.use_ssl
|
||||
ssl=self.use_ssl,
|
||||
archive=self.archive
|
||||
)
|
||||
conn.connect(self.username, self.password)
|
||||
elif self.type == 'pop3':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue