Hello
When I try to create an account so do I get this error: Request failed with status code 500
I use the latest nextcloud and mail. It has been like this for an long time though a year or so..
I noticed in the horde_imap.log:
C: 12 STATUS procmail.log (MESSAGES UIDNEXT UIDVALIDITY)
S: 12 NO [CANNOT] Mailbox isn't a valid mbox file (0.001 + 0.000 secs).
Command 12 took 0.048 seconds.
ERROR: mail server explicitly reporting an error.
C: 13 LOGOUT
S: * BYE Logging out
S: 13 OK Logout completed (0.001 + 0.000 secs).
The server that I try to connect to uses Dovecot: dovecot-imapd 1:2.3.4.1-5+deb10u1
The same mail server works well with thunderbird and roundcube webmail.
Any idea how to debug it more or something to try?
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
It tries to open procmail.log. What is this mailbox?
On 1/7/20 2:21 PM, Christoph Wurst wrote:
>
It tries to open procmail.log. What is this mailbox?
Hi
Procmail was installed and configured to do server side filtering on
incoming email.
When i removed procmail from the server and disabled server side
filtering on incoming email, then it started to work.
I do not know why nexcloud mail reads procmail.log since it was not an
subscribed mailbox.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/nextcloud/mail/issues/2412?email_source=notifications&email_token=ALVATESJWNZ4Q5GS4NEILUTQ4RXWJA5CNFSM4J6RRJ62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIIWFLQ#issuecomment-571564718,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ALVATEWUJSXATI5GQ64DXCDQ4RXWJANCNFSM4J6RRJ6Q.
I do not know why nexcloud mail reads procmail.log since it was not an subscribed mailbox.
Hm. We currently list all mailboxes. We don't take the subscripted state into consideration. But IMO the IMAP server should set the \noselect attribute on that mailbox if clients are not allowed to access it.
@kalle-ankan, maybe you can try the following patch which workes for our instance:
diff --git a/lib/IMAP/FolderMapper.php b/lib/IMAP/FolderMapper.php
index 4f677f85..6f5b7656 100644
--- a/lib/IMAP/FolderMapper.php
+++ b/lib/IMAP/FolderMapper.php
@@ -68,6 +68,11 @@ class FolderMapper {
return null;
}
+ if (strpos($mailbox['mailbox']->utf8, 'shared.') === 0) {
+ // Workaround for shared Horde folders.
+ return null;
+ }
+
return new Folder(
$account->getId(),
$mailbox['mailbox'],
To elaborate a bit on @stweil 's comment above:
For us, Nextcloud Mail suddenly stopped working and after some debugging we found a few shared folders were the issue. I am not sure which mechanism created them (might not necessarily be Horde) but on a raw IMAP connection I see the following:
. list "" "*"
* LIST (\Noinferiors \HasNoChildren) "." INBOX
* LIST (\HasNoChildren) "." Archives
* LIST (\HasNoChildren) "." Drafts
* LIST (\HasNoChildren) "." Queue
...
* LIST (\HasNoChildren) "." shared.Archives01
* LIST (\HasNoChildren) "." shared.Archives_restored
Querying the status of the shared mailboxes creates an error:
. STATUS "shared.Archives01" (messages)
. NO System I/O error
Because of this, Nextcloud Mail will refuse to set up an account, or if the account already existed it will stop working (exclamation mark symbol next to account in Nextcloud). Horde for example will list those folder fine and only after navigating there, it will show a popup notifying about the access failure.
I am not sure how to fix this properly. Just listing subscribed mailboxes would fix the issues for us as well, but maybe it would be better to catch the error when appropriate...so at least the working folders are displayed and can be navigated.
Unfortunately we don't have direct access to the mail server, so we can't fix the "actual" issue here.
Edit: the IMAP server is Cyrus IMAP v2.4.19 in case that matters
Could someone please provide the full stack trace from nextcloud.log? I'd like to fix this, but I can't reproduce the problem here due to the lack of a test account.
I can't reproduce the problem here due to the lack of a test account.
If anyone could provide one please send me the credentials via mail.
On 4/27/20 9:29 AM, Christoph Wurst wrote:
Hi
I can't reproduce it anymore.
What was causing it before was the use of procmail.
I added procmail back but it works now for some reason..
Could someone please provide the full stack trace from nextcloud.log?
I'd like to fix this, but I can't reproduce the problem here due to
the lack of a test account.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/nextcloud/mail/issues/2412#issuecomment-619757091,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ALVATEWEPXYEK2DOS6RYRMDROUQ4TANCNFSM4J6RRJ6Q.
I added procmail back but it works now for some reason..
Wait 2h :alarm_clock: :bomb: :boom:
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.
Problem still exists in 9.0. Call stack:
Error mail OCA\Mail\Exception\ServiceException: IMAP errorIMAP error reported by server.
/var/www/cloud/apps/mail/lib/BackgroundJob/SyncJob.php - line 91:
OCA\Mail\IMAP\MailboxSync->sync(OCA\Mail\Account {}, true)
/var/www/cloud/lib/public/BackgroundJob/Job.php - line 80:
OCA\Mail\BackgroundJob\SyncJob->run({ accountId: 25})
/var/www/cloud/lib/public/BackgroundJob/TimedJob.php - line 61:
OCP\BackgroundJob\Job->execute(OC\BackgroundJob\JobList {}, OC\Log {})
/var/www/cloud/cron.php - line 126:
OCP\BackgroundJob\TimedJob->execute(OC\BackgroundJob\JobList {}, OC\Log {})
Verursacht durchHorde_Imap_Client_Exception_ServerResponse: IMAP error reported by server.
/var/www/cloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php - line 4314:
Horde_Imap_Client_Socket->_getLine(Horde_Imap_C ... }})
/var/www/cloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php - line 4242:
Horde_Imap_Client_Socket->_sendCmdChunk(Horde_Imap_C ... }}, [ Horde_Imap ... }])
/var/www/cloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php - line 1751:
Horde_Imap_Client_Socket->_sendCmd(Horde_Imap_C ... }})
/var/www/cloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php - line 1733:
Horde_Imap_Client_Socket->_status([ Horde_Imap ... }], 63)
/var/www/cloud/apps/mail/lib/IMAP/FolderMapper.php - line 115:
Horde_Imap_Client_Base->status({ INBOX: "IN ... "})
/var/www/cloud/apps/mail/lib/IMAP/MailboxSync.php - line 86:
OCA\Mail\IMAP\FolderMapper->getFoldersStatus({ INBOX: OCA ... }}, Horde_Imap_C ... e})
/var/www/cloud/apps/mail/lib/BackgroundJob/SyncJob.php - line 91:
OCA\Mail\IMAP\MailboxSync->sync(OCA\Mail\Account {}, true)
/var/www/cloud/lib/public/BackgroundJob/Job.php - line 80:
OCA\Mail\BackgroundJob\SyncJob->run({ accountId: 25})
/var/www/cloud/lib/public/BackgroundJob/TimedJob.php - line 61:
OCP\BackgroundJob\Job->execute(OC\BackgroundJob\JobList {}, OC\Log {})
/var/www/cloud/cron.php - line 126:
OCP\BackgroundJob\TimedJob->execute(OC\BackgroundJob\JobList {}, OC\Log {})
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.
@ChristophWurst, I can help with testing and provide more information if needed. Here is another hack which allows mail access for me:
diff --git a/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php b/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php
index 12d6dfa..32b5c67 100644
--- a/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php
+++ b/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php
@@ -4599,6 +4599,8 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base
break;
}
+ break;
+
throw new Horde_Imap_Client_Exception_ServerResponse(
Horde_Imap_Client_Translation::r("IMAP error reported by server."),
0,
A better solution would be adding a command handler to catch IMAP errors (see code comment some lines above the hack).
https://github.com/nextcloud/mail/pull/3116 could potentially help with this. See the PR description on which mailboxes we now fetch.
You can get a prerelease from https://github.com/nextcloud/mail/releases/tag/v1.4.0-rc2
1.4.0-rc2 does not fix the issue.
Too bad. But thanks for testing anyway.
@stweil is your issue about procmail.log as well btw or is there another problematic file/mailbox that we should ignore?
did you run occ mail:account:sync <accountid> btw? if not, the new code might not have updated the mailboxes list yet.
Running that fails:
sudo -u www-data php /var/www/cloud/occ mail:account:sync 28
In MailboxSync.php line 88:
IMAP errorIMAP error reported by server.
In Socket.php line 4602:
IMAP error reported by server.
mail:account:sync [-f|--force] [--] <account-id>
@stweil is your issue about procmail.log as well btw or is there another problematic file/mailbox that we should ignore?
See @jmechnich's comment above. The IMAP server provides the list of folders for my user account, but some of these folders cannot be read because of missing rights. Those folders should be ignored (or listed as unaccessible), but currently they make the whole account unusable.
After updating to mail 1.4.0-rc2 the bad mail account (id 28) is still in the database, but no longer visible in the web interface. The Nextcloud log still shows IMAP errors (OCA\Mail\Exception\ServiceException: IMAP errorIMAP error reported by server.)
My hack works with 1.4.0-rc2, too.
I think I have a better hack :)
I removed my hack and added your fix for MailboxSync.php. Now occ mail:account:sync 28 works, and I can access my mail account. The Nextcloud log is also nearly silent now (only Warning | mail | not enough messages to train a classifier). So your hack looks good, thanks a lot.
Creating a new account with the problematic IMAP server now works, too.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@ChristophWurst Could you have a look at https://github.com/nextcloud/mail/pull/4318 ? Thanks!