OJS stopped sending mails after upgrade from to

I am using OJS on the CentOS Linux release 7.6.1810 with SELinux. Everything was working just fine before I have upgraded it to version The upgrade to this version also required the upgrade of PHP so I upgraded it from ver. 5.4 (from centOS repository) to version 7.2 (from remi repository). After upgrade I have noticed that OJS is not sending emails and I cannot send email to users anymore.
At first, when I would write an email to a user and click send, a dialog would disappeared like everything is OK. In logs (message, maillog, audit/audit.log, httpd/error_log) I cannot find anything that would explain what is happening. I have asked system administrator to check logs on SMTP server, but he did not find any coming from OJS. I have one service on server which is reporting some activities via email and it works fine. Then I have downgraded PHP to 5.6, no effect.
Then I have upgraded it back to version 7.2 and now when I want to send mail to a user, the dialog does not close (on the far right side of send button indicator is rotating). I can cancel it and still no errors in logs. I have tried to disable SELinux temporarily, but no results.
I think that it might be a problem with PHP if some modules are missing that I am not aware of. These are packages which I have installed:

yum list installed | grep php72
php.x86_64                              7.2.14-1.el7.remi              @remi-php72
php-cli.x86_64                          7.2.14-1.el7.remi              @remi-php72
php-common.x86_64                       7.2.14-1.el7.remi              @remi-php72
php-gd.x86_64                           7.2.14-1.el7.remi              @remi-php72
php-json.x86_64                         7.2.14-1.el7.remi              @remi-php72
php-ldap.x86_64                         7.2.14-1.el7.remi              @remi-php72
php-mbstring.x86_64                     7.2.14-1.el7.remi              @remi-php72
php-mysqlnd.x86_64                      7.2.14-1.el7.remi              @remi-php72
php-pdo.x86_64                          7.2.14-1.el7.remi              @remi-php72
php-pecl-mailparse.x86_64               3.0.2-8.el7.remi.7.2           @remi-php72
php-pecl-mcrypt.x86_64                  1.0.2-1.el7.remi.7.2           @remi-php72
php-pecl-zip.x86_64                     1.15.4-1.el7.remi.7.2          @remi-php72
php-xml.x86_64                          7.2.14-1.el7.remi              @remi-php72
  • My server informations:
OS platform Linux
PHP version 7.2.14
Apache version Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.2.14
Database driver mysqli
Database server version 5.5.60-MariaDB
  • email
smtp On
smtp_server my_smtp_server
smtp_port 25
allow_envelope_sender On
default_envelope_sender my_email
time_between_emails 3600
max_recipients 10
require_validation Off
validation_timeout 1
  • Email Settings from config.inc.php
; Email Settings ;


; Use SMTP for sending mail instead of mail()
smtp = On

; SMTP server settings
smtp_server = my_smtp_server
smtp_port = 25

; Enable SMTP authentication
; Supported mechanisms: ssl, tls
; smtp_auth = ssl
; smtp_username = username
; smtp_password = password

; Allow envelope sender to be specified
; (may not be possible with some server configurations)
allow_envelope_sender = On

; Default envelope sender to use if none is specified elsewhere
default_envelope_sender = my@email

; Force the default envelope sender (if present)
; This is useful if setting up a site-wide noreply address
; The reply-to field will be set with the reply-to or from address.
; force_default_envelope_sender = Off

; Amount of time required between attempts to send non-editorial emails
; in seconds. This can be used to help prevent email relaying via OJS.
time_between_emails = 3600

; Maximum number of recipients that can be included in a single email
; (either as To:, Cc:, or Bcc: addresses) for a non-priveleged user
max_recipients = 10

; If enabled, email addresses must be validated before login is possible.
require_validation = Off

; Maximum number of days before an unvalidated account expires and is deleted
validation_timeout = 1

Can you help me, please? I run out of options and ideas.

Do you have modules for ssl installed on your server?

Thank you for immediate reply!

I have checked for modules with php -m and it lists openssl .
In the section apache2handler of the phpinfo() under Loaded modules I can see mod_ssl.
The package php-common.x86_64 provides php_openssl. So, I guess that SSL modules are installed.

Maybe you will find more info here:

Thank you for pointing me in right direction. I now started looking in ssl_error_log and noticed this line:

PHP Parse error: syntax error, unexpected '*', expecting function (T_FUNCTION) or const (T_CONST) in /var/www/html/eng-mod/lib/pkp/lib/vendor/phpmailer/phpmailer/class.phpmailer.php on line 163
I have probably by mistake entered * while searching why emails are not being sent. This has solved problem with window closing after clicking send.

Finally, error message has appeared :slight_smile:
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting, referer: https://web-site/index.php/ijem/management/settings/access

I have gone through the troubleshooting and I cannot find anything relating to this problem, especially when I have one service which is using SMTP and it is working normally. So it came to me that I have recently tested the sendmail from the command line and it works just fine. I have turned SMTP to OFF in config.inc.php and OJS started to send emails.
The problem with SMTP still persists, but at least I have solve the problem.
Thank you for the support.

I am glad that you find out solution.

We had the same problem. And came to this same solution))

1 Like

Yes, but that says that your OJS did not communicate with smtp part of mail server (or that smtp is msiconfigured) and that OJS use its php (mail) function. That is fine, but it could be good to continue to investigate why that happened.
I have had recently similar situation on one server and I realized that ssl was misconfigured. We purchased our own ssl certificate for mail.ourdomain.org and it works well now.

As for us, we did not change anything. It just came after upgrading to too:

We have had case that regardless of smtp authentication it did not work.I suppose that something is problem that servers on which mail server works are configured in a way that their ssl certificate protects server with mail but not server/account on which is OJS. Thus, communication did not succeed.