From 5fcf1b5434f42a55ebe4dd083d3021f27234d0cf Mon Sep 17 00:00:00 2001 From: phail Date: Thu, 14 Apr 2022 00:19:30 +0200 Subject: [PATCH] remove uneeded print and fix merge fail --- src/paperless_mail/mail.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/paperless_mail/mail.py b/src/paperless_mail/mail.py index c80517c6e..1e868ceaa 100644 --- a/src/paperless_mail/mail.py +++ b/src/paperless_mail/mail.py @@ -90,18 +90,14 @@ def make_criterias(rule): def get_mailbox(server, port, security): - try: - if security == MailAccount.IMAP_SECURITY_NONE: - mailbox = MailBoxUnencrypted(server, port) - elif security == MailAccount.IMAP_SECURITY_STARTTLS: - mailbox = MailBoxTls(server, port) - elif security == MailAccount.IMAP_SECURITY_SSL: - mailbox = MailBox(server, port) - else: - raise NotImplementedError("Unknown IMAP security") # pragma: nocover - except Exception as e: - print(f"Error while retrieving mailbox from {server}: {e}") - raise + if security == MailAccount.ImapSecurity.NONE: + mailbox = MailBoxUnencrypted(server, port) + elif security == MailAccount.ImapSecurity.STARTTLS: + mailbox = MailBoxTls(server, port) + elif security == MailAccount.ImapSecurity.SSL: + mailbox = MailBox(server, port) + else: + raise NotImplementedError("Unknown IMAP security") # pragma: nocover return mailbox