Email notification does not work (error in Logging file)

Hello everyone,

I am using NC 10.0.2 as of now (still waiting for the update-available message in the cloud software) and installed in on a Pi 3 using the official manual “Installation on Linux” from the website. The problem I encounter is that I (or any other user) do not receive any notification emails from Nextcloud although all of us entered a valid email address in the personal settings.

Checking in with the admin account and going to the logging section I see that there seems to be an error occuring with the automatic email notification service. However I have no idea at all what this message is supposed to mean, so maybe anyone can help me out on this one?

Here is the error message in full-length:

Error while running background job (class: OCA\Activity\BackgroundJob\EmailNotification, arguments: ): {“Exception”:“Doctrine\DBAL\Exception\SyntaxErrorException”,“Message”:“An exception occurred while executing ‘DELETE FROM oc_activity_mq WHERE amq_timestamp <= ? AND amq_affecteduser IN ()’ with params [1483210278]:\n\nSQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘)’ at line 1”,“Code”:0,“Trace”:"#0 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(116): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException(‘An exception oc…’, Object(Doctrine\DBAL\Driver\PDOException))\n#1 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(175): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), ‘DELETE FROM `oc…’, Array)\n#2 /var/www/nextcloud/apps/activity/lib/MailQueueHandler.php(293): Doctrine\DBAL\Statement->execute(Array)\n#3 /var/www/nextcloud/apps/activity/lib/BackgroundJob/EmailNotification.php(145): OCA\Activity\MailQueueHandler->deleteSentItems(Array, 1483210278)\n#4 /var/www/nextcloud/apps/activity/lib/BackgroundJob/EmailNotification.php(99): OCA\Activity\BackgroundJob\EmailNotification->runStep(25, 1483210278)\n#5 /var/www/nextcloud/lib/private/BackgroundJob/Job.php(53): OCA\Activity\BackgroundJob\EmailNotification->run(NULL)\n#6 /var/www/nextcloud/lib/private/BackgroundJob/TimedJob.php(54): OC\BackgroundJob\Job->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log))\n#7 /var/www/nextcloud/cron.php(145): OC\BackgroundJob\TimedJob->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log))\n#8 {main}",“File”:"/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php",“Line”:90} <

This is a known error and a fix is available:

how to apply a patch:

Hello and thank you very much for your reply.

This topic has been marked as “solved”, I do not know by whom. At least I was able to test the fix you have linked just yesterday.
Yes - the error message that came up before is no longer present looking at the “Logging” page on my Nextcloud.
Unfortunately I am still not able to receive any emails, same goes for all the other users on my Nextcloud. There is no new error message and email notification is enabled on every user account. Do I need any extra software to get notifications sent out by Nextcloud?

that was probably me. If the error messages match and we think that it probably solves the problem, it is marked as solved.

Sending emails can be a bit difficult sometimes as other server settings can interfer. Personally, I use ssmtp on my host to forward mails to a real mailserver. Handing over mails from Nextcloud works without problem (send mode php, or sendmail) and then use ssmtp for the rest. ssmtp is very small, takes little resources and problems can be easier tracked.

Alternatively you may try sendmail, postfix or another mail offering configured as an internet site to ping out mails directly from the server.

Don’t use sendmail, it’s hard to configure. Sending out mails directly is probably difficult, many mail providers block ip-ranges from customer DSL lines (I suppose the RPi is operated at home). On business connections this is a suitable option.

I’ve installed either sendmail or postfix on every server I’ve needed mail sent from. All Ubuntu, but all generally works out of the box - postfix only needing to be configured initially as an internet site.

Other distros may not be so accommodating, and should email get blocked it shows in the mail logs usually, but hasn’t been a problem on my last few ISPs.

Mileage may vary :slight_smile:

Yes you can do that. ssmtp is smaller, it only sends out mails (can’t receive) and you don’t run the risk of configuring an open relay. Only drawback is that it doesn’t have a queue. Mails that fail to be sent end up in a textfile.

The joys of FOSS, many tools for the job to suit any preference :smiley:

I was looking at nullmailer yesterday too.