We are running OJS 2.4.8 and since our organisation implemented SPF, outgoing emails from OJS where the from: address is external are being blocked. We are using PHP mail().
I’m not clear what configuration can circumvent this.
The central email address to be used by default would be the one provided in Journal Setup Step 1.2: Principal Contact, which should match the domain name from which the journal sends mail. (If this email address cannot match the sending domain on a per-journal basis, an alternate email address can be configured at the site level via the OJS config.inc.php file)
Which field specifically in the config file is this? And does this setting override the “Principal Contact” setting in Journal Setup Step 1.2?
What I’d like to be able to do is:
- set up an address site-wide used as the FROM: address which matches the sending server’s domain
- have the REPLY-TO: address be the Journal manager’s address
- not have our organisational mail server reject the messages!
Is that possible and if so, what’s the best way to configure this?
Which exact release of OJS are you using? OJS 2.4.8 currently has 3 builds – 2.4.8-0, 2.4.8-1, and 2.4.8-2.
Public Knowledge Project Team
Have you tried the envelope sender settings in
config.inc.php? It sounds like you may want to use
Public Knowledge Project Team
No I haven’t, but I’m in the process of organising an address to use for that. Trouble is, I need the “From” header to match the envelope sender (due to my organisation’s SPF policy) and I don’t know how to set that in OJS.
And then I need the Reply-To header to be set as the legitimate sender’s address. I don’t think this code:
is in 188.8.131.52 (at least I can’t find any file called classes/mail/Mail.inc.php).
That Pull Request is still outstanding for acceptance in 2.4.9. To find the classes/mail/Mail.inc.php, look under the lib/pkp folder from you OJS install. This is part of the shared PKP library.
Hi Clinton and Alec,
Thanks very much for your responses. Can I outline what I think would remedy this situation and would you mind letting me know if my thinking is erroneous in any way please?
i) I have my central IT dept create a generic role-based email account for me
ii) I set this as the value for default_envelope_sender and set force_default_envelope_sender = On
iii) I also set this as the value of the from: address for all emails. How do I do that?
iv) I have the reply-to: address set to the actual address I want people to reply to (eg. email@example.com - addresses external to our organisation). How do I do that?
Thanks very much for your help. We have some very frustrated users at the moment.
The aforementioned pull request, in combination with the setup you describe for default_envelope_sender and set force_default_envelope_sender, will manipulate the from and reply-to as you are wanting.
This does assume that your mail server permits setting the envelope sender (Gmail does not, for example).