Unwanted emails sent from development installation

Description of issue or problem I’m having:

OJS sends bulk emails from a development installation (running on a copy of the production database) without any admin intervention.

Steps I took leading up to the issue:

Nothing to do with email, just clicking around in the backend as an administrator.

What I did to resolve the issue:

UPDATE users SET email = concat(email, '.invalid');

This is obviously a dirty workaround.
The advice I read here (from 2017): OJS 3.0.1.0 sends mail after smtp is turned Off
is probably in the same order of dirtiness (providing non-functioning smtp information).
I would expect OJS to NOT start sending bulk emails without an explicit “go” from an administrator.
A general configuration option: “never send any email”, specifically for development and testing installations, would also be helpful.
Are there, since 2017, better options to stop this behavior than the two “dirty” ones mentioned here?

Application Version - e.g., OJS 3.1.2:

OJS 3.3.0.7

Thanks,
Jan Pieter Kunst

Hi Jan,

If OJS has scheduled tasks enabled (in the config.inc.php file) and scheduled tasks are loaded in the database, it will send email. For our own testing installations we completely delete the plugins/generic/acron directory just to ensure that it will not ever communicate with the outside world.

There are other reasons for doing this too, since if scheduled tasks are running you may want to make sure the development install has not been submitting data to e.g. Crossref for DOIs.

Best
Jason

1 Like

I set the permissions of plugin/generic/acron to 000.
Easier to revert and should have the same effect as deleting the directory.

Yes. I should have mentioned that since we track our installation with git and local branches, deleting a directory and then reverting it is as easy as running git checkout plugins/generic/acron.

Best
Jason