Problems with Mail: Unable to trash mails or drafts+ hard to have mailboxs working + unable to add a gmail

Support intro

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Hello everybody ! And thanks in advance for your help ! :wink:

SERVER
VPS Contabo
system: Debian 10
Système d’exploitation: Linux 4.19.0-20-amd64 x86_64
CPU: AMD EPYC 7282 16-Core Processor (6 cores)
Mémoire: 15.67 GB

INTERFACE = Yunohost ver 11.0.9.15

DOMAINS + DNS = ovh

NEXTCLOUD = 24.0.5
App MAIL = 1.14

NGINX = ?

PHP
Version: 8.0.24
memory limit: 512 MB
exe time max: 3600
max download size: 10 GB

MYSQL
Version: 10.5.15
Taille: 7,8 MB

ISSUES:

Is this the first time you’ve seen this error? = It never worked correctly

Steps to replicate it:

Hard to have mailboxes working and +

  1. Add a mailbox with auto or manual conf = same problems
  2. It’s possible to read mails but not send them. “sent” “trash” “draft” etc… files do not exist. Draft can’t be saved.
  3. Open rainloop installed on my Yunohost server. Check the mailbox that causes problems in NC. Open “sent”, “trash”… files, send a mail. (everything works fine here)
  4. Go back to NC, remove Mail App, reinstall it. Now the mailbox got its files mentionned above.
  5. I can send mails, save drafts. I can’t delete a mail or a draft, I have to select for each new mail “activate the formating”. In the mailbox parameters, I can’t select a file to indicate “delete file”, can’t save my choice for raw or rich text (it stays row), the imap and smtp passwword boxes stay empty with red lines even if I saved that infos before.

Unable to add a gmail:

  1. Add a mailbox with the gmail reco infos, auto or manual
  2. message error: invalid imap username or password whereas that infos are correct

The output of your Nextcloud log in Admin > Logging:

dont know how to get this

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

dont know how to get this

The output of your Apache/nginx/system log in /var/log/____:

dont know how to get this

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

[mail] Erreur: Exception: OCA\Mail\Controller\AccountsController::update(): Argument #2 ($accountName) must be of type string, null given, called in /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php on line 225 in file '/var/www/nextcloud/apps/mail/lib/Controller/AccountsController.php' line 157

    /var/www/nextcloud/lib/private/AppFramework/App.php - line 172:

    OC\AppFramework\Http\Dispatcher->dispatch()

    /var/www/nextcloud/lib/private/Route/Router.php - line 298:

    OC\AppFramework\App::main()

    /var/www/nextcloud/lib/base.php - line 1030:

    OC\Route\Router->match()

    /var/www/nextcloud/index.php - line 36:

    OC::handleRequest()

Causé par TypeError: OCA\Mail\Controller\AccountsController::update(): Argument #2 ($accountName) must be of type string, null given, called in /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php on line 225

    /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 225:

    OCA\Mail\Controller\AccountsController->update("*** sensiti ... *")

    /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 133:

    OC\AppFramework\Http\Dispatcher->executeController()

    /var/www/nextcloud/lib/private/AppFramework/App.php - line 172:

    OC\AppFramework\Http\Dispatcher->dispatch()

    /var/www/nextcloud/lib/private/Route/Router.php - line 298:

    OC\AppFramework\App::main()

    /var/www/nextcloud/lib/base.php - line 1030:

    OC\Route\Router->match()

    /var/www/nextcloud/index.php - line 36:

    OC::handleRequest()
[mail] Erreur: OCA\Mail\Exception\ServiceException: Could not load message at <<closure>>

0. /var/www/nextcloud/apps/mail/lib/Controller/MessagesController.php line 248
   OCA\Mail\Service\MailManager->getImapMessage()
1. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 225
   OCA\Mail\Controller\MessagesController->getBody()
2. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 133
   OC\AppFramework\Http\Dispatcher->executeController()
3. /var/www/nextcloud/lib/private/AppFramework/App.php line 172
   OC\AppFramework\Http\Dispatcher->dispatch()
4. /var/www/nextcloud/lib/private/Route/Router.php line 298
   OC\AppFramework\App::main()
5. /var/www/nextcloud/lib/base.php line 1030
   OC\Route\Router->match()
6. /var/www/nextcloud/index.php line 36
   OC::handleRequest()

GET /apps/mail/api/messages/2109/body
from an IP by me at 2022-10-12T21:26:56+00:00

Causé par OCP\AppFramework\Db\DoesNotExistException: Message does not exist

    /var/www/nextcloud/apps/mail/lib/Service/MailManager.php - line 181:

    OCA\Mail\IMAP\MessageMapper->find()

    /var/www/nextcloud/apps/mail/lib/Controller/MessagesController.php - line 248:

    OCA\Mail\Service\MailManager->getImapMessage()

    /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 225:

    OCA\Mail\Controller\MessagesController->getBody()

    /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 133:

    OC\AppFramework\Http\Dispatcher->executeController()

    /var/www/nextcloud/lib/private/AppFramework/App.php - line 172:

    OC\AppFramework\Http\Dispatcher->dispatch()

    /var/www/nextcloud/lib/private/Route/Router.php - line 298:

    OC\AppFramework\App::main()

    /var/www/nextcloud/lib/base.php - line 1030:

    OC\Route\Router->match()

    /var/www/nextcloud/index.php - line 36:

    OC::handleRequest()

[mail] Erreur: Saving draft failed: No drafts mailbox configured

POST /apps/mail/api/accounts/7/draft
from an IP by me at 2022-10-12T20:43:41+00:00
[mail] Avertissement: OCA\Mail\Exception\ClientException: Could not send messageNo sent mailbox configured at <<closure>>

0. /var/www/nextcloud/apps/mail/lib/Service/OutboxService.php line 132
   OCA\Mail\Service\MailTransmission->sendLocalMessage()
1. /var/www/nextcloud/apps/mail/lib/Service/OutboxService.php line 215
   OCA\Mail\Service\OutboxService->sendMessage()
2. /var/www/nextcloud/apps/mail/lib/BackgroundJob/OutboxWorkerJob.php line 55
   OCA\Mail\Service\OutboxService->flush()
3. /var/www/nextcloud/lib/public/BackgroundJob/Job.php line 79
   OCA\Mail\BackgroundJob\OutboxWorkerJob->run()
4. /var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php line 95
   OCP\BackgroundJob\Job->execute()
5. /var/www/nextcloud/cron.php line 151
   OCP\BackgroundJob\TimedJob->execute()

at 2022-10-12T20:30:03+00:00

Causé par OCA\Mail\Exception\SentMailboxNotSetException: No sent mailbox configured

    /var/www/nextcloud/apps/mail/lib/Service/MailTransmission.php - line 277:

    OCA\Mail\Service\MailTransmission->sendMessage()

    /var/www/nextcloud/apps/mail/lib/Service/OutboxService.php - line 132:

    OCA\Mail\Service\MailTransmission->sendLocalMessage()

    /var/www/nextcloud/apps/mail/lib/Service/OutboxService.php - line 215:

    OCA\Mail\Service\OutboxService->sendMessage()

    /var/www/nextcloud/apps/mail/lib/BackgroundJob/OutboxWorkerJob.php - line 55:

    OCA\Mail\Service\OutboxService->flush()

    /var/www/nextcloud/lib/public/BackgroundJob/Job.php - line 79:

    OCA\Mail\BackgroundJob\OutboxWorkerJob->run()

    /var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php - line 95:

    OCP\BackgroundJob\Job->execute()

    /var/www/nextcloud/cron.php - line 151:

    OCP\BackgroundJob\TimedJob->execute()
[no app in context] Avertissement: Host 127.0.0.1 was not connected to because it violates local access rules

GET /apps/mail/api/avatars/url/wordpress%40iambabs.com
from an IP by me at 2022-10-12T20:25:27+00:00
[index] Erreur: OCP\Http\Client\LocalServerException: Host violates local access rules at <<closure>>

 0. /var/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php line 136
    OC\Http\Client\LocalAddressChecker->ThrowIfLocalIp()
 1. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php line 35
    OC\Http\Client\DnsPinMiddleware->OC\Http\Client\{closure}("*** sensitive parameters replaced ***")
 2. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 31
    GuzzleHttp\PrepareBodyMiddleware->__invoke()
 3. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php line 71
    GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***")
 4. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 63
    GuzzleHttp\RedirectMiddleware->__invoke()
 5. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php line 75
    GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***")
 6. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php line 331
    GuzzleHttp\HandlerStack->__invoke()
 7. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php line 168
    GuzzleHttp\Client->transfer()
 8. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php line 187
    GuzzleHttp\Client->requestAsync()
 9. /var/www/nextcloud/lib/private/Http/Client/Client.php line 218
    GuzzleHttp\Client->request()
10. /var/www/nextcloud/apps/mail/lib/Controller/ProxyController.php line 118
    OC\Http\Client\Client->get()
11. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 225
    OCA\Mail\Controller\ProxyController->proxy()
12. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 133
    OC\AppFramework\Http\Dispatcher->executeController()
13. /var/www/nextcloud/lib/private/AppFramework/App.php line 172
    OC\AppFramework\Http\Dispatcher->dispatch()
14. /var/www/nextcloud/lib/private/Route/Router.php line 298
    OC\AppFramework\App::main()
15. /var/www/nextcloud/lib/base.php line 1030
    OC\Route\Router->match()
16. /var/www/nextcloud/index.php line 36
    OC::handleRequest()

GET /apps/mail/proxy?src=https%3A%2F%2Fcloud.mydomain.ovh%2Fapps%2Fsettings%2Fimg%2Fpersonal.png&requesttoken=alongtoken
from an IP V6 by me at 2022-10-09T18:23:50+00:00
[index] Erreur: OCP\Http\Client\LocalServerException: Could not detect any host at <<closure>>

0. /var/www/nextcloud/lib/private/Http/Client/Client.php line 184
   OC\Http\Client\LocalAddressChecker->ThrowIfLocalAddress()
1. /var/www/nextcloud/lib/private/Http/Client/Client.php line 217
   OC\Http\Client\Client->preventLocalAddress()
2. /var/www/nextcloud/apps/mail/lib/Controller/ProxyController.php line 118
   OC\Http\Client\Client->get()
3. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 225
   OCA\Mail\Controller\ProxyController->proxy()
4. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 133
   OC\AppFramework\Http\Dispatcher->executeController()
5. /var/www/nextcloud/lib/private/AppFramework/App.php line 172
   OC\AppFramework\Http\Dispatcher->dispatch()
6. /var/www/nextcloud/lib/private/Route/Router.php line 298
   OC\AppFramework\App::main()
7. /var/www/nextcloud/lib/base.php line 1030
   OC\Route\Router->match()
8. /var/www/nextcloud/index.php line 36
   OC::handleRequest()

GET /apps/mail/proxy?src=https%3A%2F%2F%2Fapps%2Fsurvey_client%2Fimg%2Fapp-dark.svg&requesttoken=a long gtoken
from IP V6 by me at 2022-10-08T11:44:59+00:00

Thanks again for your help ! :wink:

Gmail blocks most mail clients as “unsecure”. After login im Gmail with your brower you can allow “unsecure” clients for several weeks.

Login in Nextcloud als administrator. Click on the Admin-Icon in the upper right cormer and select “Admin” and then “Logging” at left border after scrolling down .

You will need login permissions on the linux console. Then you might find the log in /var/log/nextclod.log

==> Apparently this Gmail option is not supported anymore, so no gmail in NC. Nevermind, not a big problem since we should quit progressively google.

NC log:

  • There’s no nexcloud.log at var/log, a folder nexcloud yes, but it’s empty
  • Anyway I gave the main errors of this file that I can’t find on my first post ( via admin > log), am I wrong ?
    => Is it not enough to at least start to know what going wrong ?
    => I have to convince my association team to switch from google to NC + Yuno. Unfortunately we don’t have dev or sys admin in our team, so I do it with my poor knowledges ;-). I already can install Rainloop or Roundcube, but it’s quite poor compared to google suite. If I manage to make Mail in Nexcloud work properly with the integrated functions working with the other native apps, then I’m quite sure I can convince.
    => Thanks again for any help ! :wink:

Nginx log:
I think I’ve found where it is, but there dozens of files, which on to choose ? And what to hide to make it safe to share ?

NC php config, that I found at var/www/Nexcloud/config:

<?php
$CONFIG = array (
  'passwordsalt' => 'a long key',
  'secret' => 'an even longer key',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => 'cloud.mydomain.ovh',
  ),
  'datadirectory' => '/home/yunohost.app/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '24.0.5.1',
  'overwrite.cli.url' => 'https://cloud.mydomain.ovh',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'a long key',
  'installed' => true,
  'instanceid' => 'a short key',
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'updatechecker' => false,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'integrity.check.disabled' => true,
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => '6379',
    'timeout' => '0.0',
    'password' => '',
  ),
  'onlyoffice' => 
  array (
    'jwt_header' => 'AuthorizationJwt',
  ),
  'hashing_default_password' => true,
  'localstorage.allowsymlinks' => true,
  'simpleSignUpLink.shown' => false,
  'logout_url' => 'https://mydomain.ovh/yunohost/sso/?action=logout',
  'maintenance' => false,
  'loglevel' => 2,
  'app_install_overwrite' => 
  array (
    0 => 'documentserver_community',
  ),
  'mail_from_address' => 'myusername',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_domain' => 'mydomain.ovh',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtpport' => '587',
  'mail_smtphost' => 'mydomain.ovh',
  'mail_smtpname' => 'myusername',
  'mail_smtppassword' => 'mypassword',
);

Hello everyone,
Any ideas when you read my logs ?
Thanks again.