Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
in Q2A Core by
My website sends thousands of email notification per hour that make my website hosting provider suspend my website even I will turn off sending emails from my website , So which are that emails the website sends and how I can turn off its?

1 Answer

+2 votes

There are no options for that in Q2A currently, but it's a good point so maybe it can be added in future.

In the meantime, one way is to override the qa_send_notification in an override plugin. Here's an example I did a while back to turn off wall posts:

function qa_send_notification($userid, $email, $handle, $subject, $body, $subs, $html = false)
    if ( $subject == qa_lang('emails/wall_post_subject') )
        return false;
        return qa_send_notification_base($userid, $email, $handle, $subject, $body, $subs, $html);

You could modify this to check against all the types of email you don't want to send. Look in qa-include/lang/qa-lang-emails.php for the different language keys to check against.

Please is there any files , codes or folder if I remove it or rename it temporary it will never sends any messages ?
You can find the original qa_send_notification function which is in qa-include/app/emails.php.
Then comment out everything between the { and }
edited by
After contact my website hosting provider and after they did check the website
It appears that the emails not just because notifications emails but the website sends auto root email see the following message it is from my website provider :


However, even if we migrated you over to the new system, issues may still persist if it has the same configurations.

We have mitigated the mail in your queue by changing lf_alert_to to lfd-notifications@eeee.com

Before we were seeing large amounts of messages being generated by LFD by root, but this has subsided.

There appears to be one other cron job that is generating messages but not at a rapid rate. Here is the message and cron info below:

root@mail.eeee.com [~]# exim -Mvh 1ZSRKv-0000LT-6W
root 0 0
1440082861 0
-ident root
-received_protocol local
-body_linecount 1
-max_received_linelength 106

182P Received: from root by mail.eeee.com with local (Exim 4.85)
(envelope-from <root@mail.eeee.com>)
id 1ZSRKv-0000LT-6W
for root@mail.eeee.com; Thu, 20 Aug 2015 15:01:01 +0000
025* From: root (Cron Daemon)
041F From: root@mail.eeee.com (Cron Daemon)
009* To: root
025T To: root@mail.eeee.com
107 Subject: Cron <root@mail> /var/dist_client/kds_install.pl 2>&1 1>/var/dist_client/log/kds_install.cron.out
040 Content-Type: text/plain; charset=UTF-8
031 Auto-Submitted: auto-generated
031 X-Cron-Env: <LANG=en_US.UTF-8>
030 X-Cron-Env: <SHELL=/bin/bash>
049 X-Cron-Env: <PATH=/sbin:/bin:/usr/sbin:/usr/bin>
026 X-Cron-Env: <MAILTO=root>
021 X-Cron-Env: <HOME=/>
027 X-Cron-Env: <LOGNAME=root>
024 X-Cron-Env: <USER=root>
048I Message-Id: <E1ZSRKv-0000LT-6W@mail.eeee.com>
038 Date: Thu, 20 Aug 2015 15:01:01 +0000

You may need to double check that cron job.

Let us know if you need anything else later on.