Merge pull request #915 from evili/master

Add support for standard STARTTLS on port 143 (RFC 2595).
This commit is contained in:
Garret Wassermann 2020-12-04 11:01:39 -05:00 committed by GitHub
commit 87c949859f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -101,6 +101,10 @@ def process_email(quiet=False):
def pop3_sync(q, logger, server):
server.getwelcome()
try:
server.stls()
except Exception:
logger.warning("POP3 StartTLS failed or unsupported. Connection will be unencrypted.")
server.user(q.email_box_user or settings.QUEUE_EMAIL_BOX_USER)
server.pass_(q.email_box_pass or settings.QUEUE_EMAIL_BOX_PASSWORD)
@ -138,6 +142,10 @@ def pop3_sync(q, logger, server):
def imap_sync(q, logger, server):
try:
try:
server.starttl()
except Exception:
logger.warning("IMAP4 StartTLS unsupported or failed. Connection will be unencrypted.")
server.login(q.email_box_user or
settings.QUEUE_EMAIL_BOX_USER,
q.email_box_pass or