Jump to content

Recommended Posts

Is there any way possible to block an email address in the back office?

 

Let's say you're getting nasty messages from a visitor who does not register, plus the email is a random address that cannot be tracked...

 

Is there a way to just prevent this person from contacting again through the back office... exactly like blocking an email address in gmail.

Link to comment
Share on other sites

Yeah that's great, but my main problem is that someone sent us a message and they didn't register.

 

Somehow, they went to the contact page, put in an offensive email address, also added an offensive message and just hit send.

 

In the back office, the only thing I could do was delete the message. I could not get an IP address, a referring link/url, nor could i block him from future messages.

Link to comment
Share on other sites

you can look at your access log (on your hosting account) and look for ip that accessed the contact page...but then you will need to modify the .htaccess (most likely solution that I know of to ban the IP). Also you may find the IP in the email header (not sure). with my work using ip for country geo location I should spin off an IP blocker module...:)

Link to comment
Share on other sites

  • 8 years later...
2 hours ago, Snobs said:

I would like to follow up on this thread, especially as the question was posted in 2013!!!

Recently I have been bombarded with promotional emails from one specific company/person/email address, as stated above I deleted their account & prevented them setting up another account under the same email address. Now they just email directly without setting up an account!

I don't understand why the PrestaShop customer service module doesn't have the blocking/baring facility, as it is pretty standard in all other system, Outlook, Instagram, WhatsApp, Google Mail etc. & if it has the ability to block someone from setting up an account with the same email already???

This is something that the PrestaShop's developers need to address as a matter of urgency in my opinion, my site is still under construction & as such the eCommerce side of the site has not gone functionally live yet. This means the site has not been promoted or SEO'd yet! 

I dread to think of how much crap I will have to deal with & delete! Especially as we all know good Mailchimp & other emailers are & how they can be set up to continuously send out promotional emails!

Regards

Snob

PS provides base cart/pages.  For shops that need additional feature they can most likely be found on PrestaShop addon's.  PS is not a mail server, that is done at hosting or 3rd party mail server.  

It's fairly simple to add a I'm not robot module to your shop pages.  

el

Link to comment
Share on other sites

  • 2 months later...
On 6/7/2021 at 7:46 PM, Snobs said:

I already have the I am not a robot module installed, so maybe I am misunderstanding what is happening within the PS Customer Section? 

You say that "PS is not a mail server, that is done at hosting or 3rd party mail server." So what is the Customer Services section if its not for handling emails? Does it only handle message that are left from within the site?

The email I have highlighted, keeps sending me messages every few days, I keep deleting them & then they come back again, so I have been trying to find away of preventing them leaving any more messages, any adviser would be gratefully received!

image.thumb.png.a9a0121b706555693cc76bc3c9fa9dbf.png

 

I am having the EXACT same problem. I'm getting messages every few days through PS plus more in my outlook inbox saying Message Delivery Fail - I get a minimum of 5 of these. If there's something I'm missing here and we aren't able to block certain emails even if they haven't registered, then I'd like to know what I'm suppose to do. I've responded to him and he still won't leave me alone - I get the same message every few days. I've blocked him on Outlook as best I can but these messages through PS are driving me insane.

2021-08-22 (2).png

2021-08-22 (3).png

Link to comment
Share on other sites

  • 1 month later...

We've been getting the Eric Jones spam too. About one every 2 days since early August.

We have Google recaptcha installed for over a year but somehow they get around it.

It would be good if someone would develop a Prestashop module for bouncing or blacklisting spammers, in the same way for example, as AppleMail has rules and spam filters and a 'block this sender' feature. I have no technical knowledge but such a module shouldn't be too difficult to develop.

Edited by Jazzman
expanded (see edit history)
Link to comment
Share on other sites

  • 3 months later...

Eric Jones drives everyone nuts. It's obviously the work of a mind-crippled freak with some knowledge how to get round the captcha. The content of the message is all fake. It's surprising Google does not shut down his email account - it's not as if the issue is unknown.

More to the point, and sadder still, is the ongoing manner in which Prestashop treats its customers. This should be a quick fix and not even a payable module.

 

 

Edited by Jazzman
punctuation (see edit history)
Link to comment
Share on other sites

  • 1 month later...

Whoever still have issue with such spam, here is simple fix by creating override of contactform module. If you want to block more email adresses, just add them to array.

<?php
if (!defined('_PS_VERSION_'))
    exit;

class ContactformOverride extends Contactform {
   

	public function sendMessage()
    {
		$banned = array('[email protected]','[email protected]');
		if(!in_array(trim(Tools::getValue('from')),$banned)){
			$extension = ['.txt', '.rtf', '.doc', '.docx', '.pdf', '.zip', '.png', '.jpeg', '.gif', '.jpg'];
			$file_attachment = Tools::fileAttachment('fileUpload');
			$message = trim(Tools::getValue('message'));
			$url = Tools::getValue('url');
			$clientToken = Tools::getValue('token');
			$serverToken = $this->context->cookie->contactFormToken;
			$clientTokenTTL = $this->context->cookie->contactFormTokenTTL;
	
			if (!($from = trim(Tools::getValue('from'))) || !Validate::isEmail($from)) {
				$this->context->controller->errors[] = $this->trans(
					'Invalid email address.',
					[],
					'Shop.Notifications.Error'
				);
			} elseif (empty($message)) {
				$this->context->controller->errors[] = $this->trans(
					'The message cannot be blank.',
					[],
					'Shop.Notifications.Error'
				);
			} elseif (!Validate::isCleanHtml($message)) {
				$this->context->controller->errors[] = $this->trans(
					'Invalid message',
					[],
					'Shop.Notifications.Error'
				);
			} elseif (!($id_contact = (int)Tools::getValue('id_contact')) ||
					!(Validate::isLoadedObject($contact = new Contact($id_contact, $this->context->language->id)))
			) {
				$this->context->controller->errors[] = $this->trans(
					'Please select a subject from the list provided. ',
					[],
					'Modules.Contactform.Shop'
				);
			} elseif (!empty($file_attachment['name']) && $file_attachment['error'] != 0) {
				$this->context->controller->errors[] = $this->trans(
					'An error occurred during the file-upload process.',
					[],
					'Modules.Contactform.Shop'
				);
			} elseif (!empty($file_attachment['name']) &&
					!in_array(Tools::strtolower(Tools::substr($file_attachment['name'], -4)), $extension) &&
					!in_array(Tools::strtolower(Tools::substr($file_attachment['name'], -5)), $extension)
			) {
				$this->context->controller->errors[] = $this->trans(
					'Bad file extension',
					[],
					'Modules.Contactform.Shop'
				);
			} elseif ($url !== ''
				|| empty($serverToken)
				|| $clientToken !== $serverToken
				|| $clientTokenTTL < time()
			) {
				$this->context->controller->errors[] = $this->trans(
					'An error occurred while sending the message, please try again.',
					[],
					'Modules.Contactform.Shop'
				);
				$this->createNewToken();
			} else {
				$customer = $this->context->customer;
	
				if (!$customer->id) {
					$customer->getByEmail($from);
				}
	
				/**
				* Check that the order belongs to the customer.
				*/
				$id_order = (int) Tools::getValue('id_order');
				if (!empty($id_order)) {
					$order = new Order($id_order);
					$id_order = (int) $order->id_customer === (int) $customer->id ? $id_order : 0;
				}
	
				$id_customer_thread = CustomerThread::getIdCustomerThreadByEmailAndIdOrder($from, $id_order);
	
				if ($contact->customer_service) {
					if ((int)$id_customer_thread) {
						$ct = new CustomerThread($id_customer_thread);
						$ct->status = 'open';
						$ct->id_lang = (int)$this->context->language->id;
						$ct->id_contact = (int)$id_contact;
						$ct->id_order = $id_order;
	
						if ($id_product = (int)Tools::getValue('id_product')) {
							$ct->id_product = $id_product;
						}
						$ct->update();
					} else {
						$ct = new CustomerThread();
						if (isset($customer->id)) {
							$ct->id_customer = (int)$customer->id;
						}
						$ct->id_shop = (int)$this->context->shop->id;
						$ct->id_order = $id_order;
	
						if ($id_product = (int)Tools::getValue('id_product')) {
							$ct->id_product = $id_product;
						}
						$ct->id_contact = (int)$id_contact;
						$ct->id_lang = (int)$this->context->language->id;
						$ct->email = $from;
						$ct->status = 'open';
						$ct->token = Tools::passwdGen(12);
						$ct->add();
					}
	
					if ($ct->id) {
						$lastMessage = CustomerMessage::getLastMessageForCustomerThread($ct->id);
						$testFileUpload = (isset($file_attachment['rename']) && !empty($file_attachment['rename']));
	
						// if last message is the same as new message (and no file upload), do not consider this contact
						if ($lastMessage != $message || $testFileUpload) {
							$cm = new CustomerMessage();
							$cm->id_customer_thread = $ct->id;
							$cm->message = $message;
	
							if ($testFileUpload && rename($file_attachment['tmp_name'], _PS_UPLOAD_DIR_ . basename($file_attachment['rename']))) {
								$cm->file_name = $file_attachment['rename'];
								@chmod(_PS_UPLOAD_DIR_ . basename($file_attachment['rename']), 0664);
							}
							$cm->ip_address = (int)ip2long(Tools::getRemoteAddr());
							$cm->user_agent = $_SERVER['HTTP_USER_AGENT'];
	
							if (!$cm->add()) {
								$this->context->controller->errors[] = $this->trans(
									'An error occurred while sending the message.',
									[],
									'Modules.Contactform.Shop'
								);
							}
						} else {
							$mailAlreadySend = true;
						}
					} else {
						$this->context->controller->errors[] = $this->trans(
							'An error occurred while sending the message.',
							[],
							'Modules.Contactform.Shop'
						);
					}
				}
				$sendConfirmationEmail = Configuration::get(self::SEND_CONFIRMATION_EMAIL);
				$sendNotificationEmail = Configuration::get(self::SEND_NOTIFICATION_EMAIL);
	
				if (!count($this->context->controller->errors)
					&& empty($mailAlreadySend)
					&& ($sendConfirmationEmail || $sendNotificationEmail)
				) {
					$var_list = [
						'{firstname}' => '',
						'{lastname}' => '',
						'{order_name}' => '-',
						'{attached_file}' => '-',
						'{message}' => Tools::nl2br(Tools::htmlentitiesUTF8(Tools::stripslashes($message))),
						'{email}' =>  $from,
						'{product_name}' => '',
					];
	
					if (isset($customer->id)) {
						$var_list['{firstname}'] = $customer->firstname;
						$var_list['{lastname}'] = $customer->lastname;
					}
	
					if (isset($file_attachment['name'])) {
						$var_list['{attached_file}'] = $file_attachment['name'];
					}
					$id_product = (int)Tools::getValue('id_product');
	
					if ($id_order) {
						$order = new Order((int)$id_order);
						$var_list['{order_name}'] = $order->getUniqReference();
						$var_list['{id_order}'] = (int)$order->id;
					}
	
					if ($id_product) {
						$product = new Product((int)$id_product);
	
						if (Validate::isLoadedObject($product) &&
							isset($product->name[Context::getContext()->language->id])
						) {
							$var_list['{product_name}'] = $product->name[Context::getContext()->language->id];
						}
					}
	
					if ($sendNotificationEmail) {
						if (empty($contact->email) || !Mail::Send(
							$this->context->language->id,
							'contact',
							$this->trans('Message from contact form', [], 'Emails.Subject').' [no_sync]',
							$var_list,
							$contact->email,
							$contact->name,
							null,
							null,
							$file_attachment,
							null,
							_PS_MAIL_DIR_,
							false,
							null,
							null,
							$from
						)) {
							$this->context->controller->errors[] = $this->trans(
								'An error occurred while sending the message.',
								[],
								'Modules.Contactform.Shop'
							);
						}
					}
	
					if ($sendConfirmationEmail) {
						$var_list['{message}'] = self::MESSAGE_PLACEHOLDER_FOR_OLDER_VERSION;
	
						if (!Mail::Send(
							$this->context->language->id,
							'contact_form',
							((isset($ct) && Validate::isLoadedObject($ct)) ? $this->trans(
								'Your message has been correctly sent #ct%thread_id% #tc%thread_token%',
								[
									'%thread_id%' => $ct->id,
									'%thread_token%' => $ct->token
								],
								'Emails.Subject'
							) : $this->trans('Your message has been correctly sent', [], 'Emails.Subject')),
							$var_list,
							$from,
							null,
							null,
							null,
							$file_attachment,
							null,
							_PS_MAIL_DIR_,
							false,
							null,
							null,
							$contact->email
						)) {
							$this->context->controller->errors[] = $this->trans(
								'An error occurred while sending the message.',
								[],
								'Modules.Contactform.Shop'
							);
						}
					}
				}
	
				if (!count($this->context->controller->errors)) {
					$this->context->controller->success[] = $this->trans(
						'Your message has been successfully sent to our team.',
						[],
						'Modules.Contactform.Shop'
					);
				}
			}
		}else{
			$this->context->controller->errors[] = $this->trans(
				'Invalid email address.',
				[],
				'Shop.Notifications.Error'
			);			
		}
	}
}

 

contactform.zip

  • Like 2
Link to comment
Share on other sites

  • 3 weeks later...

Thank you for the code ❤️

If you're familiar with the PS code I would appreciate a little addition that sends an email back to Eric Jones's email address every time he spams. It could may be say that he's a jerk or may be it could contain a few MBs of lorem ipsum.

Link to comment
Share on other sites

21 hours ago, JohannaH said:

Thank you for the code ❤️

If you're familiar with the PS code I would appreciate a little addition that sends an email back to Eric Jones's email address every time he spams. It could may be say that he's a jerk or may be it could contain a few MBs of lorem ipsum.

Sadly such email doesn't exist, so sending any message back to the sender wouldn't do much to him.

Link to comment
Share on other sites

  • 2 weeks later...

Could someone point me in the right direction on where exactly to put the file in 1.6.1  I've put it in a bunch of different spots in the overrides folder and cleared the cache but this doesn't seem to work.  Its likely a matter of me just putting it in the right spot i just don't know where it belongs.

Link to comment
Share on other sites

11 hours ago, ScottC613 said:

Could someone point me in the right direction on where exactly to put the file in 1.6.1  I've put it in a bunch of different spots in the overrides folder and cleared the cache but this doesn't seem to work.  Its likely a matter of me just putting it in the right spot i just don't know where it belongs.

It works only on ps 1.7, because contact form was moved to module. In 1.6 you need to override contactcontroller.php

Link to comment
Share on other sites

  • 2 weeks later...

I received 65 messages from "eric jones" in the past two weeks. I filed a Can Spam report with the FTC, but if the address is fake it won't do any good. I am on 1.6, so I can't implement the provided code and I will not pay for a plugin for such a simple feature that should be included. 

Link to comment
Share on other sites

Open source doesn't mean all is free.

@madmartian On forum is a lot of tutorials how you can disable unwanted messages from specific email address, what differs between 1.6 and 1.7 is file where you must do changes but code in both files is simmilar and changes are almost identical.

@Snobs Prestashop is open source so if any thing is missing or not working as expect you can look into code and add missing functionallity or fix any issue, also those changes you can provide on prestashop github project and probably they will be added in future with next version release. Thats how opens source work.

I think there isn't any other opensource platform with that much free functionality as prestashop have, of cource prestashop is not ready for all bussiness thats why you might need some modules, themes or services by programmers. You can also learn how make those changes by yourself and then you can make it all for free.

 

 

Once I also had problem with unwanted email thats why I make module to protect my contact form for specific email addresses, domains, some signs, and also I added reCaptcha protection. You can make those changes for free in your store or you can hire programmer  and pay someone for his job or buy ready module.

  • Like 1
  • Sad 1
Link to comment
Share on other sites

Quote

The PS Customer services module is not fit for purpose, it should be more powerful & have all the standard Email/customer database controls that come as standard with Outlook or Gmail or any other PIM or Contact Database control program, if its already out there, it cant be too difficult for PS to develop it for its own improved Customer services module with spam blocker etc, its not like they are having to figure out what needs to be done, just how to implement what others have already done.

Like I wrote before you can hire someone to make those changes and you can pull it to prestashop github to make theme free in future.

 

 

Quote

I sell motorcycles, if a customer buys one from me & when he turns up to ride it away & there are no wheels on it, am I supposed to tell him he can just buy wheels else where???

You have PrestaShop for free, so if you give your customer your motcycles also for free without wheels I think they will buy those wheels because it's not that much cost like buy whole vehicle.

 

Quote

I have also ( I added reCaptcha protection) however my complaint is what I wrote, which you have ignored, the PS Customer database has the most limited of functionality

You can easly extends any part on prestashop, by making changes in code or by installing moduls.

 

Quote

 If you want to contribute to this thread, then do that contribute something positive, help PS create  install a more sophisticated Contact database manager, that would help everyone!

In that case you have right this thread is about spam issue, not for reading yours complaints or reading my "not relevant" comments, so any other post not in topic subject will be removed, so please do not reply to my post.

  • Like 1
  • Sad 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...