How to set email return-path in ojs

I m using 2.4.8.0 and I figured out that my email return-path was not sent. How can I assign an email address to email return-path ?

Hi @zaratushtra,

I believe it’s your mail server that’s responsible for setting the return-path header, not the originating software; see RFC 5321 - Simple Mail Transfer Protocol for details.

Regards,
Alec Smecher
Public Knowledge Project Team

hi @asmecher,

actually when I send email from outlook my email server’s return-path works okay. However, when I send email from my journal web site by clicking send email button to the authors, return-path appears like this :

I found a related topic :

but could not solve the problem as there is no file called Mail.inc.php in my installation.

Mail.inc.php is in the shared library. To find it, look in your lib/pkp folder, under classes/mail.

Hey @ctgraham,

thank your for the information. But changing mail.in.php according to

https://github.com/pkp/pkp-lib/commit/7af3bf24a2e24f8e2f4afcde4750d7b16d9b80f7

did not solve the problem still I have a strange looking return-path when I send emails from journal website, and I believe that is why my emails end up at spam folder.

You can tell OJS to supply a return-path header, but your mailserver is what will ultimately determine what it allows at the return-path. As @asmecher mentions, it looks like your mailserver is creating this return-path.

I’ve found that most spam flagging is due to SPF and DMARC failures. Have you investigated these configurations?

@ctgraham

SPF is passing almost always, I was thinking that return-path could be the reason.

Delivered-To: editor.ejers@gmail.com
Received: by 10.46.20.24 with SMTP id u24csp848147ljd;
Thu, 11 May 2017 12:08:10 -0700 (PDT)
X-Received: by 10.28.67.130 with SMTP id q124mr41321wma.17.1494529690772;
Thu, 11 May 2017 12:08:10 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1494529690; cv=none;
d=google.com; s=arc-20160816;
b=Lhnj2Y+DIbc3cELxrmv116EbknAfvfILQpBPORA1FNEqpG04pdmO5o4+Hxn/bJTnvZ
zj0d8ED2LwEMDbVTF3GX4w6cSWZXX47IfiW0wUuQ/+kURJC1YKUjxW2IV6uSiHfeGY/v
yP0PayuLc46Mo5LPtPV8+zZrZB5qGcKSa2Bj8D7yoVfhPf0jtxzHFh9fIppu3kqJDSOd
t9jqjqjDF1F8PWJJzvBCdwxgGBnRdgTv5NdCluAzzkAUeM6FWgP9wPKSqnumhpT+jM5A
WePRBR2vrZwz1MQ9I0rM1HS4dwMi0YVRL3JQaSsUlNkzd9Dj8wOX9AlcPk8CdxvpprqQ
N7dA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
h=message-id:reply-to:from:date:subject:to:arc-authentication-results;
bh=3KEuX2SVCWFyvnIp26v3i4IWh3QKiU7/DE0ikFPJENU=;
b=WBv5SKJ7tjeIduMWlExaGEBTMhpbiiYHPXw06v2g+ni1ffQbGBhPVSAY0HM3IblmRc
NxWjk5+DT5YX+9j2u+bfgx2lAR0wbMhNOtDk2+1lxbXmsAtgZUUgf6A02TcsWho39qBX
5OUBKqwyHl33sY91c16Z7Don6BQeYYQhMi94fA7DmTp19lUWedsnU2ZeMTrKvgGW0R2X
jkfw8C9nNL9CK11UqYBFuaN+Q0z/hU+W3ZukGfFZK7BEG1OgBvX8IxSbMy2lTIGMJ2Vq
NISIU2/BrM7qLGIB6WFmAGmShJObksmF4HK7ysnYes8a944R07JEzLVg6TTUoqAEHWHE
s3VA==
ARC-Authentication-Results: i=1; mx.google.com;
spf=pass (google.com: domain of bounce-id=d131=u625201.240plan.ovh.net=1494529690.22-4vs2v@118-prod.mail-out.ovh.net designates 178.33.106.244 as permitted sender) smtp.mailfrom=bounce-id=D131=U625201.240plan.ovh.net=1494529690.22-4VS2V@118-prod.mail-out.ovh.net
Return-Path: bounce-id=D131=U625201.240plan.ovh.net=1494529690.22-4VS2V@118-prod.mail-out.ovh.net
Received: from mo153.mail-out.ovh.net (1.mo153.mail-out.ovh.net. [178.33.106.244])
by mx.google.com with ESMTPS id 6si8846756wmh.96.2017.05.11.12.08.10
for editor.ejers@gmail.com
(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Thu, 11 May 2017 12:08:10 -0700 (PDT)
Received-SPF: pass (google.com: domain of bounce-id=d131=u625201.240plan.ovh.net=1494529690.22-4vs2v@118-prod.mail-out.ovh.net designates 178.33.106.244 as permitted sender) client-ip=178.33.106.244;
Authentication-Results: mx.google.com;
spf=pass (google.com: domain of bounce-id=d131=u625201.240plan.ovh.net=1494529690.22-4vs2v@118-prod.mail-out.ovh.net designates 178.33.106.244 as permitted sender) smtp.mailfrom=bounce-id=D131=U625201.240plan.ovh.net=1494529690.22-4VS2V@118-prod.mail-out.ovh.net

Those headers seem ok to me; I don’t know that the return-path would affect spamtrapping.

Was the message you pulled these headers from flagged as spam? Where there any SMTP headers related to the spam flagging, such as X-Spam-Score or X-Antispam-Report?

If not, you may need to ask the mail provider who is flagging the message why it was flagged.

@ctgraham

My tests emails are going to inbox including the one I showed but some reviewers (with institutional email addresses) remarked that emails ended up in their spam folder.

You’ll want to get the SMTP headers for these emails which are being spamtrapped in order to understand what conditions are causing this.

hey @ctgraham ,

Here there is a header that spamtrapped by gmail.

Delivered-To: editorial.ejers@gmail.com
Received: by 10.100.179.193 with SMTP id n59csp175917pjb;
Fri, 12 May 2017 00:25:41 -0700 (PDT)
X-Received: by 10.28.94.194 with SMTP id s185mr1559514wmb.103.1494573941097;
Fri, 12 May 2017 00:25:41 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1494573941; cv=none;
d=google.com; s=arc-20160816;
b=YYZon/nBHrsnzhM3SCYPU0gB6+U1eUYozZyGUZzLLEHw9EDFc4QGXgI3dTf+jZmqeE
hsDlXCPInSoNhDOH0tfJ03S6fgQeO8ngTitN/qmRt/ViaGFVdRTsFX0LlkmfvTduAN9m
h8V4dkRngI5PgS7m0SED25a6e275OkTsZuFMtfRwhN3r7X/NgquIqow20x+7OijFeAcK
3+7WZHjeUFSCMxJVU9avHp9DEtMJ7PNYLMjbcxm/Df11o68U92vdRrb9n+47UWBuvCoI
zKqWqNnjQLbdpg23ZtPweDqpaA1y6SKYzstC9bxXfFtMHbqy1mhVkQnK7wn5YIlZc4nk
opFw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
h=message-id:reply-to:from:date:subject:to:arc-authentication-results;
bh=uGWF9iHlcx8srrOojzYzPq9mQtmU6UbCGja12yAwm80=;
b=sWJ1F2P2q6b29PftN1mWjdgmoK/ftdD+3bWcniRKyk0RWtkuVf/bvieQAPydBJXHFD
taI2BMr8c6/HvaxdhcSbQhv3X1gpkYVmR1ohztHSXbFbJcThsr94cD1e1uODY209Vm01
GNBymzJq+lHUM0/WEiSdtkmOZh18ME62vkB4u3cqekMEALSNy5Q31KNDu780EDTyff0q
xFGGpyiSty/jJJlalzMknasUshKNyEh8sZV6+6OBZtEEDJWE2+VUY7Ut2UjPWCCPl1JE
tgJBafcdZFnPPgoIrjT4rJpDOfgdGrEOFu3sCr4COK38suJ3e/NciYbRTgTSDivwYvsv
wDLw==
ARC-Authentication-Results: i=1; mx.google.com;
spf=pass (google.com: domain of bounce-id=d132=u625201.240plan.ovh.net=1494573940.23-71o3l@118-prod.mail-out.ovh.net designates 46.105.73.238 as permitted sender) smtp.mailfrom=bounce-id=D132=U625201.240plan.ovh.net=1494573940.23-71O3L@118-prod.mail-out.ovh.net
Return-Path: bounce-id=D132=U625201.240plan.ovh.net=1494573940.23-71O3L@118-prod.mail-out.ovh.net
Received: from mo166.mail-out.ovh.net (10.mo166.mail-out.ovh.net. [46.105.73.238])
by mx.google.com with ESMTPS id m4si2717008wrb.16.2017.05.12.00.25.40
for editorial.ejers@gmail.com
(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Fri, 12 May 2017 00:25:41 -0700 (PDT)
Received-SPF: pass (google.com: domain of bounce-id=d132=u625201.240plan.ovh.net=1494573940.23-71o3l@118-prod.mail-out.ovh.net designates 46.105.73.238 as permitted sender) client-ip=46.105.73.238;
Authentication-Results: mx.google.com;
spf=pass (google.com: domain of bounce-id=d132=u625201.240plan.ovh.net=1494573940.23-71o3l@118-prod.mail-out.ovh.net designates 46.105.73.238 as permitted sender) smtp.mailfrom=bounce-id=D132=U625201.240plan.ovh.net=1494573940.23-71O3L@118-prod.mail-out.ovh.net
Received: from 118.mail-out.ovh.net (unknown [10.108.25.242]) by mo166.mail-out.ovh.net (Postfix) with ESMTP id 67F7A899A8 for editorial.ejers@gmail.com; Fri, 12 May 2017 09:25:40 +0200 (CEST)
Received: from 118.mail-out.ovh.net (localhost [127.0.0.1]) by 118.mail-out.ovh.net (Postfix) with ESMTP id 4CC2380033 for editorial.ejers@gmail.com; Fri, 12 May 2017 09:25:40 +0200 (CEST)
Received: from 240plan.ovh.net (gw-cluster003.ovh.net [213.251.182.103]) by 118.mail-out.ovh.net (Postfix) with ESMTP id 9D09380033 for editorial.ejers@gmail.com; Fri, 12 May 2017 09:25:39 +0200 (CEST)
Received: from localhost.localdomain (localhost [127.0.0.1]) by localhost.domain.tld (Postfix) with ESMTP id 8D85840CB8 for editorial.ejers@gmail.com; Fri, 12 May 2017 09:25:39 +0200 (CEST)
Received: by 240plan.ovh.net (Postfix, from userid 625201) id 7F77040CC0; Fri, 12 May 2017 09:25:39 +0200 (CEST)
To: test gmail editorial.ejers@gmail.com
Subject: [EJERS]deneme
Content-Type: text/plain; charset=“utf-8”
X-Mailer: Public Knowledge Project Suite v2
X-Originating-IP: 143.169.153.190
Date: Fri, 12 May 2017 09:25:39 +0200
From: European Journal of Engineering Research and Science editor@ejers.org
Reply-To: Editor in Chief editor@ejers.org
Message-Id: 20170512072539.7F77040CC0@240plan.ovh.net
X-Ovh-Tracer-Id: 7166071432710681595
X-VR-SPAMSTATE: OK
X-VR-SPAMSCORE: 10
X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeeljedrtdeigdduvdejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucgopfhokfffucdluddtmd

and when I send the same email from outlook, it ends up to gmail inbox, here you may see its header

Delivered-To: editorial.ejers@gmail.com
Received: by 10.100.179.193 with SMTP id n59csp179496pjb;
Fri, 12 May 2017 00:39:07 -0700 (PDT)
X-Received: by 10.28.37.71 with SMTP id l68mr1496526wml.108.1494574747089;
Fri, 12 May 2017 00:39:07 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1494574747; cv=none;
d=google.com; s=arc-20160816;
b=Yr5iFYaNDiNPSwLQbuQwyWQCNjUmnqHFzZgcC1yv45IgcasMDxoxZSvR3bhLeenvN8
UjofM00hSMYq8HjfPXazfup6+cMXdfnxfSrP/yamcF3EC6zCXGeqyVAYXc+Qhy8fu6sb
Oai0YB1f3VQG2Fs3gD2JBGryzE5FdkenXsfDs5APhpd8vcBNZaYSgm7IHq1ul2DTOYbz
B51NfdtYXIogfuNhWwzXNQMxioqP72/mgDORd0ZSnCAIsSYMBBg4ZnhBLP05NB2N3HHx
Z2Ulkuw2U/O/p66Pb8bi4cAIr5wLzDiX0EU0OhO+WCC5pNwYWNyxfaUTcheJe/8u5VfP
3loQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
h=user-agent:message-id:subject:to:from:date
:content-transfer-encoding:mime-version:arc-authentication-results;
bh=8OeT+qXUScHdQxBHug0QE1rUNg2r22cZkEHX8k8N5MI=;
b=F7CdN/woq8h9X8wzW42WFZXLXJzhcybL6J8AefjYEsYgzUq+y5SqHOI25vUgigNmbK
LRWf78bZXa5+FnVoHuvWndLwu35sgfcPHayFMP9R2g0Q3QKOL+mdedJG4ZUAoaKQ7zxj
q7ADophPf9W+XzyWsk3CARTOlpdjGEcT5+KJQaDZH3dUpmDSTdapE4NRxgKRWubdgPmf
8LA3kM+vsHrwhgNLwOrmHlCPcLWL/b7Mzb1hPB90JiiGRCJTiZnUVL4CmqvGy+UuzTY+
hlip3+K2ZyZIYHPcElrBOqPc7bgEoPMrui2gj+Hu+795f+3n55+zk95ehwc7wTnWAmuh
Befg==
ARC-Authentication-Results: i=1; mx.google.com;
spf=pass (google.com: domain of editor@ejers.org designates 178.32.122.241 as permitted sender) smtp.mailfrom=editor@ejers.org
Return-Path: editor@ejers.org
Received: from 2.mo14.mail-out.ovh.net (2.mo14.mail-out.ovh.net. [178.32.122.241])
by mx.google.com with ESMTPS id g48si2775968wrg.239.2017.05.12.00.39.06
for editorial.ejers@gmail.com
(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Fri, 12 May 2017 00:39:07 -0700 (PDT)
Received-SPF: pass (google.com: domain of editor@ejers.org designates 178.32.122.241 as permitted sender) client-ip=178.32.122.241;
Authentication-Results: mx.google.com;
spf=pass (google.com: domain of editor@ejers.org designates 178.32.122.241 as permitted sender) smtp.mailfrom=editor@ejers.org
Received: from player696.ha.ovh.net (b6.ovh.net [213.186.33.56]) by mo14.mail-out.ovh.net (Postfix) with ESMTP id A03301BFED for editorial.ejers@gmail.com; Fri, 12 May 2017 09:39:02 +0200 (CEST)
Received: from RCM-ns3048765.ip-151-80-29.eu (unknown [143.169.153.190]) (Authenticated sender: editor@ejers.org) by player696.ha.ovh.net (Postfix) with ESMTPSA id 889C23C009E for editorial.ejers@gmail.com; Fri, 12 May 2017 09:39:02 +0200 (CEST)
Received: from [143.169.153.190] by mail.ovh.net with HTTP (HTTP/1.1 POST); Fri, 12 May 2017 09:39:02 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII; format=flowed
Content-Transfer-Encoding: 7bit
Date: Fri, 12 May 2017 09:39:02 +0200
From: editor@ejers.org
To: editorial.ejers@gmail.com
Subject: deneme
Message-ID: ee1639340b14fab4ae592d7b54af85eb@ejers.org
X-Sender: editor@ejers.org
User-Agent: Roundcube Webmail/1.2.4
X-Originating-IP: 143.169.153.190
X-Webmail-UserID: editor@ejers.org
X-Ovh-Tracer-Id: 7392095838846777083
X-VR-SPAMSTATE: OK
X-VR-SPAMSCORE: 0
X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeeljedrtdeigdduvdekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenuc

Those headers don’t raise any red flags for me in terms of why it would be spamtrapped.

I’m afraid your next steps would be to contact Gmail to inquire why it was flagged as spam, to have the receiving user whitelist the sender, and/or to ask your host to add in DKIM signing for your outgoing mail.

Hey @ctgraham

The problem started to become quite annoying as I observed that often emails from the journal web page are not delivered to Gmail at all including the Spam folder. I write to google about it but no success. I do not know what should I do, if it is about web hosting I might change it. Is there anyone you know who experienced same problem ?

What are your settings for allow_envelope_sender' and force_default_envelope_sender` in config.inc.php?

If you are using OJS’s default behaviour of setting the sender as the OJS user’s email address, this will not work with Gmail if the user’s email address domain is not authorized on your hosting provider. For example, if an editor’s email address is from @yahoo.com, Gmail will reject the message because of Yahoo’s DMARC policy.

@ctgraham,

I am using the default settings, and our e-mails are always sent from @hostname.org email address as it should be authorized by hosting provider

With the default settings, OJS will attempt to set the “From” field of the email to be the address of the OJS user. Unless all your users’ email address are @hostname.org, you may not be able to be certain that the sending will be authorized.