Reading tools, comments and notifications errors

Hi there,

Here’s a weird one. I have several instances of OJS installed on a single server, and the two in particular I’m dealing with at the moment are at 2.4.6.

In testing the reading tools commenting function on the one server, it sends three copies of the “notification of new comment” email, and also add three items in the user’s notifications panel.

However, on the other journal, when I add a comment, the comment is successfully added. However, the emails are never sent and the notifications do not appear in the user’s notifications panel.

The config.inc.php email settings are the same for both sites i.e. use built-in mail() rather than SMTP. I added some error_log() calls in /lib/pkp/classes/core/String.inc.php’s mail() function on the instance where email is not working, but when I “tail -f /var/log/httpd/maillog” while attempting to submit a comment it doesn’t register any email being sent.

Interestingly, both journals use site editor email addresses that do not match the hostname (ojs.uwaterloo.ca). However, the one sends three copies of the email, and the other sends none.

Any pointers in the right direction are appreciated.

Have a great weekend.

Cheers,

Graham

Hi @gfaulkner,

The triplicate email problem is particularly confusing – I’ve never seen that before. Just to ensure you’re dealing with a good comparison between the two, could you try comparing the two installations using diff? This might help to identify any unexpected differences between the two codebases.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alec,

I did some diff’g of both instances (each had been upgraded to 2.4.6 using ‘download patch’ rather than through git) against a checkout of ojs-stable-2_4_6 on GitHub, and there were lots of differences. =(

Are there any places I should look first, in regards to the email, commenting and notifications functionality?

Ideally I need to just upgrade both sites to the latest code base, but they are in line after some other sites that are still on earlier versions.

Cheers,

Graham

Hi @gfaulkner,

For the reading tools / commenting features, you’d probably want to look in (OTOH)…

  • pages/rt/
  • pages/comment/
  • classes/comment/
  • classes/mail
  • lib/pkp/classes/mail/

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Thanks for the feedback. I did some diffs of those spots on the two sites as per your suggestion and things are the same, and they are also are the same as ojs-stable-2_4_6, with one exception being that the site that doesn’t send emails has session_check_ip = Off and the one that sends email has session_check_ip = On.

The one that is not sending email does have contact email addresses that are of a different hostname from the server, so I wonder if that could be the problem based on reading some of the other forum entries. But why it doesn’t update the notifications page is still a puzzle.

And the one that sends three copies of the email and has three notifications per comment – that’s a head scratcher!

Cheers,

Graham

Hi @gfaulkner,

The contact address may well be the cause of messages not being received; if your mail server’s SPF (Sender Policy Framework) implementation discards messages without matching sender domains, then that would explain the problem. Consider using a different contact address and see if that improves things.

The session_check_ip setting shouldn’t be related to this; I suspect that’s a red herring.

The triple-sending still seems strange to me. Have you been able to e.g. use error_log calls to capture information about this? If I were debugging it, I’d dump a stack trace to the error log using something like…

error_log(print_r(debug_backtrace(),true));

…then compare the call traces to see where they were being invoked from.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I put the error_log() directive in /lib/pkp/classes/core/String.inc.php’s mail() function for both instances, and the one that doesn’t send email didn’t register anything in the /var/log/httpd/error_log and /var/log/maillog. The one that sends three had 100K+ entries in the /var/log/httpd/error_log and then the following in the /var/log/maillog:

May 24 16:18:04 ojs sendmail[11212]: u4OKI4FA011212: from=sandbox, size=765, class=0, nrcpts=1, msgid=<201605242018.u4OKI4FA011212@ojs.uwaterloo.ca>, relay=sandbox@localhost
May 24 16:18:05 ojs sendmail[11215]: u4OKI4ml011215: from=<sandbox@ojs.uwaterloo.ca>, size=955, class=0, nrcpts=1, msgid=<201605242018.u4OKI4FA011212@ojs.uwaterloo.ca>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
May 24 16:18:05 ojs sendmail[11212]: u4OKI4FA011212: to="sandbox " <g2faulkn@uwaterloo.ca>, ctladdr=sandbox (518/518), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30765, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (u4OKI4ml011215 Message accepted for delivery)
May 24 16:18:05 ojs sendmail[11220]: STARTTLS=client, relay=mxer.uwaterloo.ca., version=TLSv1/SSLv3, verify=FAIL, cipher=DHE-RSA-AES256-GCM-SHA384, bits=256/256

May 24 16:18:05 ojs sendmail[11237]: u4OKI5PS011237: from=sandbox, size=765, class=0, nrcpts=1, msgid=<201605242018.u4OKI5PS011237@ojs.uwaterloo.ca>, relay=sandbox@localhost
May 24 16:18:05 ojs sendmail[11241]: u4OKI5DZ011241: from=<sandbox@ojs.uwaterloo.ca>, size=955, class=0, nrcpts=1, msgid=<201605242018.u4OKI5PS011237@ojs.uwaterloo.ca>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
May 24 16:18:05 ojs sendmail[11237]: u4OKI5PS011237: to="sandbox " <g2faulkn@uwaterloo.ca>, ctladdr=sandbox (518/518), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30765, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (u4OKI5DZ011241 Message accepted for delivery)
May 24 16:18:06 ojs sendmail[11245]: STARTTLS=client, relay=mxer.uwaterloo.ca., version=TLSv1/SSLv3, verify=FAIL, cipher=DHE-RSA-AES256-GCM-SHA384, bits=256/256

May 24 16:18:06 ojs sendmail[11271]: u4OKI6ep011271: from=sandbox, size=765, class=0, nrcpts=1, msgid=<201605242018.u4OKI6ep011271@ojs.uwaterloo.ca>, relay=sandbox@localhost
May 24 16:18:06 ojs sendmail[11274]: u4OKI6KR011274: from=<sandbox@ojs.uwaterloo.ca>, size=955, class=0, nrcpts=1, msgid=<201605242018.u4OKI6ep011271@ojs.uwaterloo.ca>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
May 24 16:18:06 ojs sendmail[11271]: u4OKI6ep011271: to="sandbox " <g2faulkn@uwaterloo.ca>, ctladdr=sandbox (518/518), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30765, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (u4OKI6KR011274 Message accepted for delivery)
May 24 16:18:07 ojs sendmail[11277]: STARTTLS=client, relay=mxer.uwaterloo.ca., version=TLSv1/SSLv3, verify=FAIL, cipher=DHE-RSA-AES256-GCM-SHA384, bits=256/256

May 24 16:18:08 ojs sendmail[11245]: u4OKI5DZ011241: to=<g2faulkn@uwaterloo.ca>, ctladdr=<sandbox@ojs.uwaterloo.ca> (518/518), delay=00:00:03, xdelay=00:00:03, mailer=esmtp, pri=120955, relay=mxer.uwaterloo.ca. [129.97.128.232], dsn=2.0.0, stat=Sent (u4OKI5i5031055 Message accepted for delivery)
May 24 16:18:08 ojs sendmail[11220]: u4OKI4ml011215: to=<g2faulkn@uwaterloo.ca>, ctladdr=<sandbox@ojs.uwaterloo.ca> (518/518), delay=00:00:04, xdelay=00:00:03, mailer=esmtp, pri=120955, relay=mxer.uwaterloo.ca. [129.97.128.232], dsn=2.0.0, stat=Sent (u4OKI5lM010067 Message accepted for delivery)
May 24 16:18:09 ojs sendmail[11277]: u4OKI6KR011274: to=<g2faulkn@uwaterloo.ca>, ctladdr=<sandbox@ojs.uwaterloo.ca> (518/518), delay=00:00:03, xdelay=00:00:03, mailer=esmtp, pri=120955, relay=mxer.uwaterloo.ca. [129.97.128.232], dsn=2.0.0, stat=Sent (u4OKI6ML017253 Message accepted for delivery)

Cheers,

Graham

Hi @gfaulkner,

Hmm, can you provide me with access to the error log that contains the 100K+ entries?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @gfaulkner,

That’s a pretty noisy log, but I see the triple-send entries.

The recipients of a comment email are determined by getting a list of all authors, reviewers, editors, proofreaders, copyeditors, and layout editors. However, there’s no de-duping done, so if your account is active in more than a single role there, you’ll receive multiple notifications. Does that sound like a likely cause?

Regards,
Alec Smecher
Public Knowledge Project Team