Cannot send email from OJS

Hello OJS community,

We’re a publisher of medical journals from Indonesia. Currently we’re having a problem sending email on OJS. Previously it was worked like a charm and running well for months, but yesterday it just stopped working. We have contacted our hosting company, just in case they changed the email service port or anything like that, but the service had nothing change.

For the information, we have been applying force_default_envelope_sender shown in this link pkp/pkp-lib#1723: force_default_envelope_sender moves the traditional from to a reply-to for DMARC compliance by ctgraham · Pull Request #1724 · pkp/pkp-lib · GitHub.

This is the error message and the stacktrace we got:

There was an error sending this email. Please check your mail log (/var/log/maillog).
Stack Trace:
File: /home/u1231757/public_html/lib/pkp/classes/mail/ line 237
Function: Mail->send()

File: /home/u1231757/public_html/classes/mail/ line 163
Function: PKPMailTemplate->send(False)

File: /home/u1231757/public_html/classes/mail/ line 66
Function: MailTemplate->send(False)

File: /home/u1231757/public_html/pages/user/ line 155
Function: ArticleMailTemplate->send(Object(Request))

File: (unknown) line (unknown)
Function: EmailHandler->email(Array(0), Object(Request))

File: /home/u1231757/public_html/lib/pkp/classes/core/ line 362
Function: call_user_func(Array(2), Array(0), Object(Request))

File: /home/u1231757/public_html/lib/pkp/classes/core/ line 220
Function: PKPRouter->_authorizeInitializeAndCallRequest(Array(2), Object(Request), Array(0), False)

File: /home/u1231757/public_html/lib/pkp/classes/core/ line 134
Function: PKPPageRouter->route(Object(Request))

File: /home/u1231757/public_html/lib/pkp/classes/core/ line 178
Function: Dispatcher->dispatch(Object(Request))

File: /home/u1231757/public_html/index.php line 64
Function: PKPApplication->execute()

We also get this email sending failure notification which categorize our email as spam:

A message that you sent was rejected by the local scanning code that
checks incoming messages on this system. The following error was given:

This message was classified as SPAM and may not be delivered

------ This is a copy of your message, including all the headers.
------ No more than 100K characters of the body are included.

Received: from u123 by with local (Exim 4.87)
(envelope-from <>)
id 1cDiDU-002nXV-9q
for n; Mon, 05 Dec 2016 08:37:16 +0700
To: "N
" n*****
Subject: [PI] Article Review Request
X-PHP-Script: for
X-PHP-Filename: /home/u123
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="==boundary_663a205c881ef1e9078b423d52a3fb7c"
Return-Path: enquiry@*
X-Mailer: Public Knowledge Project Suite v2
Date: Mon, 05 Dec 2016 01:37:16 +0000
Reply-To: "Dr
" k****
Message-Id: <E1cDiDU-002nXV-9q@
Sender: <u123@****>

This message is in MIME format and requires a MIME-capable mail client to view.

Content-Type: text/plain; charset=utf-8


I believe that you would serve as an excellent reviewer of the manuscript,

What should we do? Thank you very much for the advise and the attention given.

with best regards,


if nothing has changed with the system and it suddenly started to flag your messages as spam you should check that your domain hasn’t been blacklisted from service like

Edit: Actually that IP in X-Originating-IP that you forgot to censor out is in three black lists:, and
Could be that, but it doesn’t seem like those are that strong lists. Does some email go through or is it just certain email providers?

Hello @WaDelma,

Thank you very much for the kind advise. I checked our domains against the links you gave and found that we’re not blaclisted. As for the x-originating ip, it is our dynamic ip from ISP.

We just found that this problem is intermittent with failure sending happens much much more often (spam classified). It affects all emails sent from OJS (submission ack, rejection) regardless of the domain.

What could possibly wrong? Thanks a heap for your help.

with best regards,

More details of who is rejecting the message and why are probably in your mail log:

This rejection is almost certainly happening at your hosting company, but details the mail log would clarify.

Some things to consider in why your messages might be flagged as spam are described here:

Hello @ctgraham Thanks so much for your help. I was kind of overwhelmed following the solution at Github. I’m slowly digesting it.

From what I got from the mail log, it showed that the spam trap happening several times before it finally delivered the email.

From email header, I see that SPF fail might be the culprit. Oddly that’s an email account created under my domain.

Received: by with SMTP id l91csp96581edl;
Tue, 6 Dec 2016 19:24:43 -0800 (PST)
X-Received: by with SMTP id ks4mr55089578wjb.171.1481081083741;
Tue, 06 Dec 2016 19:24:43 -0800 (PST)
Return-Path: en***
Received: from ( [])
by with ESMTPS id c2si22613057wjm.95.2016.
for ***
(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Tue, 06 Dec 2016 19:24:43 -0800 (PST)
Received-SPF: fail ( domain of en does not designate as permitted sender) client-ip=;
spf=fail ( domain of en*** does not designate as permitted sender) smtp.mailfrom=en***

This is strange because I have already applied this #1723 (DMARC comply) and worked well before that spam problem occurs.

What do you think? Many thanks in advance.

Good debugging.

Resolving the SPF problem is an action for someone who administers your DNS. The way SPF works is that a special TXT record is added to the DNS for your domain, indicating what servers are permitted to send mail on behalf of that domain.

Your domain currently has an SPF record, but it does not allow the IP of		TXT	v=spf1 +a +mx +ip4: +ip4: +ip4: -all

If mail should be coming from, allow this in your SPF record. If mail should not be coming from, check your or mailserver configuration. You may be routing your mail through an unexpected smtp service.