Jump to content
thirty bees forum

How to block emails to Customer services


AndyC

Recommended Posts

Hey all

On Friday evening I started to get emails from this specific address @qq.com every email starts off with a different number so ex is 4215998@qq.com with loads of Chinese writing.I eventually turned it off after receiving around 2000 at around 11pm last night. Turned it back on now and they are still coming in thick and fast

塨禧您已被抽为特约用戸↓载APP直接升至ViP4!

That's just 1 line ...Anyway how can I go about blocking these
 

Link to comment
Share on other sites

If all attacks comes from the same ip address than you can block the ip address on your nginx/apache server block.

if not and you need to block it on the code level, than you should make an override to ContactController postProcess function and check the email domain and block it there.

$emailParts = explode( '@', $email_address );

$emailDomain = end($emailParts);

if ($emailDomain == 'qq.com') {
	// do something
}

 

Link to comment
Share on other sites

create a file "ContactController.php" and place it inside "override/controllers/front" folder.

the file should look like this.

<?php
class ContactController extends ContactControllerCore {
	public function postProcess() {
		$email_address = Tools::convertEmailToIdn(trim(Tools::getValue('from')));
		$emailParts = explode( '@', $email_address );
		$emailDomain = end($emailParts);
		if ($emailDomain == 'qq.com') {
			header('HTTP/1.1 403 FORBIDDEN');
  			header('Status: 403 No China here!!!');
  			header("Location: https://www.qq.com/");
		}
		return parent::postProcess();
	}
}

i think it should work, don't have time to test it right now.

you should delete cache/class_index.php as well

Edited by yaniv14
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...