How to disable outbound email messages

Is there some way to temporarily disable outbound emails? We had to unpublish and republish an issue several times for an article issue and each time it seemed to generate an outbound email message to users. As a follow on, is there any to see all emails sent to particular users?
Thank you.

Hi @radjr,

see this thread.

Hope this helps

Claudia Jürgen

1 Like

This should be a switch so that users don’t get junk mail if we are tweaking the journal. Guess I should use the preview option! :slight_smile:

Hi,
is there a setting in OJS 3 to temporarily disable all emails?
I thought of:

  1. disabling all email templates from website (after setting can_disable = 1 in all rows of email_templates_default table.
  2. setting a fake SMPT setting in config.inc.php

is this going to affect editorial history?

This setting does not currently exist. What is the specific workflow where you are wanting to temporarily disable emails?

Hi @ctgraham,
Some journals want to import data from other softwares or just want a demonstration website. so, notifications are not required.
Also, currently there are some redundant emails sent from OJS3 (reported in forum) which is just bothering.

Best,

I think there are two distinct situations here:

  1. Ensuring that emails within the workflow are optional (as has been noted and addressed with disabling submission notifications).
    and
  2. Ensuring that email within a development or demonstration site is restricted.

For the first case, keep reporting these specific situations so that workflow can be improved.

For the second case, your solution of setting an invalid or development SMTP server in config.inc.php would work. I also use a script to munge any existing emails for development use, redirecting them to an address like mailinator.com or similar.

#!/bin/bash
if [ "$#" != "1" ]
then
        echo "Usage: $0 emailDomain"
        exit 1
fi

CONFIG="/var/www/html/ojs/config.inc.php"
MYSQLDATABASE=
MYSQLUSER=
MYSQLPW=
if [ -e "$CONFIG" ]
then
        MYSQLDATABASE=`grep '^name = ' $CONFIG | sed -e 's/name = //'`
        MYSQLPW=`grep '^password = ' $CONFIG | sed -e 's/password = //'`
        MYSQLUSER=`grep '^username = ' $CONFIG | sed -e 's/username = //'`
        echo "This is a one way ticket with no backup"
        echo -n "Type 'yes' if you really want to munge the emails for database '$MYSQLDATABASE': "
        read USERCONFIRM
        if [ "$USERCONFIRM" != "yes" ]
        then
                >&2 echo "Aborting"
                exit 1
        fi
        if [ "$MYSQLUSER" != ""  -a "$MYSQLPW" != "" -a "$MYSQLDATABASE" != "" ]
        then
                echo "select concat('update \`', table_schema, '\`.', table_name, ' set ', column_name, ' = concat(replace(', column_name, ', "'"'"@"'"'", "'"'"."'"'"), "'"'"@$1"'"'") where ', column_name, ' like "'"'"%_@_%"'"'"; select row_count() as updates, "'"'"', table_name, '.', column_name, '"'"'" as field;') from information_schema.columns where column_name like '%email' and data_type like '%char' and table_schema = '$MYSQLDATABASE';" | mysql -N -u $MYSQLUSER -p$MYSQLPW -D$MYSQLDATABASE | while read updatestmt
                do
                        echo "$updatestmt" | mysql -N -u $MYSQLUSER -p$MYSQLPW -D$MYSQLDATABASE
                done
                echo "select concat('update \`', n.table_schema, '\`.', n.table_name, ' set ', v.column_name, ' = concat(replace(', v.column_name, ', "'"'"@"'"'", "'"'"."'"'"), "'"'"@$1"'"'") where ', n.column_name, ' like "'"'"%email"'"'" and ', v.column_name, ' like "'"'"%_@_%"'"'"; select row_count() as updates, "'"'"', n.table_name, '.', v.column_name, '"'"'" as field;') from information_schema.columns n, information_schema.columns v where n.column_name = 'setting_name' and n.data_type like '%char' and v.column_name = 'setting_value' and v.data_type = 'text' and n.table_schema = v.table_schema and n.table_name = v.table_name and n.table_schema = '$MYSQLDATABASE'" | mysql -N -u $MYSQLUSER -p$MYSQLPW -D$MYSQLDATABASE | while read updatestmt
                do
                        echo "$updatestmt" | mysql -N -u $MYSQLUSER -p$MYSQLPW -D$MYSQLDATABASE
                done
        else
                >&2 echo "Site config not understood"
        fi
else
        >&2 echo "$CONFIG not found"
fi