A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Adds some logging so we know which login method has failed
Trenton Holmes330e47f0b794
diff --git a/src/paperless_mail/mail.py b/src/paperless_mail/mail.pyindex 4f41126cf..2b3267aeb 100644--- a/src/paperless_mail/mail.py+++ b/src/paperless_mail/mail.py@@ -167,6 +167,7 @@ class MailAccountHandler(LoggingMixin):M.login(account.username, account.password)except UnicodeEncodeError:+ self.log("debug", "Falling back to AUTH=PLAIN")try:# rfc2595 section 6 - PLAIN SASL mechanismclient: IMAP4 = M.client@@ -184,8 +185,13 @@ class MailAccountHandler(LoggingMixin):# Need to transition out of AUTH state to SELECTEDM.folder.set("INBOX")except Exception:+ self.log(+ "error",+ "Unable to authenticate with mail server using AUTH=PLAIN",+ )raise MailError(f"Error while authenticating account {account}")except Exception:+ self.log("error", "Unable to authenticate with mail server")raise MailError(f"Error while authenticating account {account}")self.log(diff --git a/src/paperless_mail/tests/test_mail.py b/src/paperless_mail/tests/test_mail.pyindex 352c3f369..85fda2975 100644--- a/src/paperless_mail/tests/test_mail.py+++ b/src/paperless_mail/tests/test_mail.py@@ -869,7 +869,7 @@ class TestMail(DirectoriesMixin, TestCase):"""GIVEN:- Mail account with password containing non-ASCII characters- - Incorrect password alue+ - Incorrect password valueTHEN:- Should raise a MailError for the account"""