Comments plug-in does not use general email (smtp) settings

Having Omeka installation at shared hosting service which means command line commands are not available. This is not problem when creating e.g. new users, as then notification emails are sent via SMTP. But with Comments plug-in that does not work and error messages are generated after submitting a comment which should initiate notification email. If not using notification emails (=no receivers set at Comments settings), no errors.

So, how come Comments is using sendmail instead of smtp? And where and how we can fix it?

Which plugin specifically are you using?

The “Commenting” plugin from the Omeka Team should be using the same mail sending code as anything else in the system. If you’re using another plugin that could be a different story.

It is Omeka’s own plugin.

Error message comes only if having email addresses for notifications (and then trying to send notifications after logging comments). If no email addresses listed (for notifications), no error messages when commenting. Below is log information.

2022-09-07T21:54:38+03:00 ERR (3): RuntimeException: PHP-polku (/usr/local/php74/bin/php) ei osoita PHP-CLI -ohjelmaan. in /home/kinxuvyqpa/domains/

Stack trace:

#0 /home/kinxuvyqpa/domains/ Omeka_Job_Process_Dispatcher::_checkCliPath()

#1 /home/kinxuvyqpa/domains/ Omeka_Job_Process_Dispatcher::getPHPCliPath()

#2 /home/kinxuvyqpa/domains/ Omeka_Job_Process_Dispatcher::startProcess()

#3 /home/kinxuvyqpa/domains/ Omeka_Job_Dispatcher_Adapter_BackgroundProcess->send()

#4 /home/kinxuvyqpa/domains/ Omeka_Job_Dispatcher_Default->sendLongRunning()

#5 /home/kinxuvyqpa/domains/ Commenting_CommentController->sendEmailNotifications()

#6 /home/kinxuvyqpa/domains/ Commenting_CommentController->addAction()

#7 /home/kinxuvyqpa/domains/ Zend_Controller_Action->dispatch()

#8 /home/kinxuvyqpa/domains/ Zend_Controller_Dispatcher_Standard->dispatch()

#9 /home/kinxuvyqpa/domains/ Zend_Controller_Front->dispatch()

#10 /home/kinxuvyqpa/domains/ Zend_Application_Bootstrap_Bootstrap->run()

#11 /home/kinxuvyqpa/domains/ Zend_Application->run()

#12 /home/kinxuvyqpa/domains/ Omeka_Application->run()

The problem here is about your server’s configuration for running background jobs: the difference isn’t that Commenting sends email with different settings, but that it uses a background job to do so.

You need to check that you have the right path to PHP configured: the message is saying that your current configured path isn’t pointing to the PHP CLI (I believe that’s what the translation there says).

Yep, we know that, as it is running on shared hosting and command line commands etc. cannot be used for security purposes.

But why sending notifications as background jobs? E.g. sending notifications when adding new users are not sent as background jobs… we need to take a look at how to change that, to make it work.

If you can’t use those commands on your host, you can set Omeka to run all background jobs as “foreground” jobs instead.

In your application/config/config.ini file there should be a line like this:

jobs.dispatcher.longRunning = "Omeka_Job_Dispatcher_Adapter_BackgroundProcess"

and you can change it to

jobs.dispatcher.longRunning = "Omeka_Job_Dispatcher_Adapter_Synchronous"

Thanks, that did the trick!