Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
This commit is contained in:
Florian Brandes 2022-04-12 15:48:50 +02:00
parent cc93616019
commit 71cbef4c13
No known key found for this signature in database
GPG Key ID: 074048E893713170

View File

@ -18,6 +18,7 @@ from imap_tools import MailboxFolderSelectError
from imap_tools import MailBoxUnencrypted
from imap_tools import MailMessage
from imap_tools import MailMessageFlags
from imap_tools.mailbox import MailBoxTls
from paperless_mail.models import MailAccount
from paperless_mail.models import MailRule
@ -92,7 +93,7 @@ def get_mailbox(server, port, security):
if security == MailAccount.ImapSecurity.NONE:
mailbox = MailBoxUnencrypted(server, port)
elif security == MailAccount.ImapSecurity.STARTTLS:
mailbox = MailBox(server, port, starttls=True)
mailbox = MailBoxTls(server, port)
elif security == MailAccount.ImapSecurity.SSL:
mailbox = MailBox(server, port)
else: