Merge pull request #705 from paperless-ngx/fix-startls

bugfix for imap using starttls
This commit is contained in:
shamoon 2022-04-12 18:51:46 -07:00 committed by GitHub
commit 045a401cd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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: