mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-10-12 02:26:09 -05:00
In the event of an error when setting the mail account folder, attempt to list the account's folders to the log
This commit is contained in:
@@ -190,6 +190,20 @@ class MailAccountHandler(LoggingMixin):
|
||||
try:
|
||||
M.folder.set(rule.folder)
|
||||
except MailboxFolderSelectError:
|
||||
|
||||
self.log(
|
||||
"error",
|
||||
f"Unable to access folder {rule.folder}, attempting folder listing",
|
||||
)
|
||||
try:
|
||||
for folder_info in M.folder.list():
|
||||
self.log("info", f"Located folder: {str(folder_info)}")
|
||||
except Exception:
|
||||
self.log(
|
||||
"error",
|
||||
"Exception during folder listing, unable to provide list folders",
|
||||
)
|
||||
|
||||
raise MailError(
|
||||
f"Rule {rule}: Folder {rule.folder} "
|
||||
f"does not exist in account {rule.account}",
|
||||
|
Reference in New Issue
Block a user