Some users can't send emails

Nextcloud version 29.0.6
Debian 12
Apache 2.4.62
PHP version 8.2 (fpm)

The issue you are facing:

Some users can’t send e-mail through the mail app.

A pop-up shows saying Message sent, and then another popup saying Unable to send.

The mail get stuck in the Send box.

Some users can send but not the others. They use the same server settings. The Authentication test works.

Is this the first time you’ve seen this error?

Yes. But it is a new install of Nextcloud.

Steps to replicate it:

  1. Open mail app
  2. New message
  3. Write message
  4. Send Message
  5. Message not sent

The output of your Nextcloud log in Admin > Logging:

Exception OCA\Mail\Controller\DraftsController::update(): Argument #2 ($accountId) must be of type int, null given, called in /usr/share/cloud/lib/private/AppFramework/Http/Dispatcher.php on line 232 in file ‘/usr/share/cloud/apps/mail/lib/Controller/DraftsController.php’ line 157

  1. /usr/share/cloud/lib/private/AppFramework/App.phpLigne 184
OC\AppFramework\Http\Dispatcher->dispatch
()
  1. /usr/share/cloud/lib/private/Route/Router.phpLigne 331
OC\AppFramework\App::main
()
  1. /usr/share/cloud/lib/base.phpLigne 1058
OC\Route\Router->match
()
  1. /usr/share/cloud/index.phpLigne 49
OC::handleRequest
()

Causé par TypeError OCA\Mail\Controller\DraftsController::update(): Argument #2 ($accountId) must be of type int, null given, called in /usr/share/cloud/lib/private/AppFramework/Http/Dispatcher.php on line 232

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

<?php $CONFIG = array ( 'instanceid' => 'blah', 'passwordsalt' => 'blah', 'secret' => 'blah', 'trusted_domains' => array ( 0 => 'blah', ), 'datadirectory' => '/usr/share/cloud/data', 'skeletondirectory' => '', 'dbtype' => 'mysql', 'version' => '29.0.6.1', 'overwrite.cli.url' => 'blah', 'dbname' => 'cloud', 'dbhost' => 'localhost', 'dbport' => '', 'dbtableprefix' => 'oc_', 'mysql.utf8mb4' => true, 'dbuser' => 'blah', 'dbpassword' => 'blah', 'installed' => true, 'maintenance_window_start' => 1, 'default_phone_region' => 'FR', 'mail_smtpmode' => 'smtp', 'mail_smtpsecure' => 'ssl', 'mail_sendmailmode' => 'smtp', 'mail_from_address' => 'cloud', 'mail_domain' => 'blah', 'mail_smtphost' => 'ssl0.ovh.net', 'mail_smtpport' => '465', 'mail_smtpauth' => 1, 'mail_smtpname' => 'blah', 'mail_smtppassword' => 'blah', 'logtimezone' => 'Europe/Paris', 'force_locale' => 'fr/FR', 'loglevel' => '2', 'debug' => false, 'memcache.local' => '\\OC\\Memcache\\APCu', 'memcache.locking' => '\\OC\\Memcache\\Redis', 'redis' => array ( 'host' => '/run/redis/redis-server.sock', 'port' => 0, 'password' => 'blah', ), 'default_language' => 'fr', 'maintenance' => false, 'log_type' => 'file', 'log_file' => '/usr/share/cloud/cloud.log', 'log_level' => '3', 'logdateformat' => 'F d, Y H:i:s', ); ############################# I have no idea what to do... Thanks for your help !

Maybe error im mail parameters
https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#mail-parameters

Check SMTP port and SMTP mode.
Please also check, whether the mail_domain is accepted by the mail server.

Hello,

the Nextcloud mail settings are Ok. New users get the welcome email, and the password recovery do works.

My problem occurs only in the Mail App.

I am really stuck with that. So far I’ve been able to set everything up except regarding this issue :cry:

The “system” mail has different settings (f.e. sender’s mail address) than the users.

Yes I know, I have no problem with the system mail settings. I am only speaking about the Mail app, that’s why we’re on the Mail App category ^^

And now please check the sender’s data in the mail-app of the affected users.
Specially sender’s mail address and credentials.

Yep, no server settings or credentials error. But in the end I gave up with the mail app which isn’t really stable yet.

Have a nice day.

GitHub issue tracker for this: `OCA\Mail\Controller\DraftsController::update(): Argument #2 ($accountId) must be of type int, null given` · Issue #9147 · nextcloud/mail · GitHub

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.