• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Block E-Mail Addresses

Block E-Mail Addresses 8 years 8 months ago #31910

We have been having problems with an individual harassing members of our site. I've banned his IP address so he can't access the site from his home computer but of course this doesn't stop him from accessing the site from mobile devices and other computers. We have to have our contact forms accessible to non registered members so it's not as if I can hide them from him that way either.

He only ever uses one of three e-mail addresses and I'd like to be able to ban/block these addresses should they be entered into a form but I can't work out how.

I had wondered about using a hidden field that checked to see if the address in the email field matched one of his known email addresses and if it did to then delete the message and redirect him to another page or display an error message but I've no idea how to do that and can't write one line of PHP.

Is this possible?
The administrator has disabled public write access.

Block E-Mail Addresses 8 years 7 months ago #31939

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

Unless you restrict the form to logged in users, I doubt a feasible solution exists. Nevertheless, an example script (while editing a form > Properties > PHP Scripts > Scripts Called on Form Process):
$emailFieldName = 'my-email-field-name-here';
$checkEmails = array('email@address.com','domain@mail.com','another@email.com');
if(in_array($_POST['form'][$emailFieldName], $checkEmails)){
	$invalid[] = RSFormProHelper::getComponentId($emailFieldName);
}

This uses the $invalid method and you can read more on this topic here. Remember to replace my-email-field-name-here with your textbox element exact name.
This is not official customer support. To receive your support, submit a support ticket here.
The administrator has disabled public write access.
The following user(s) said Thank You: huwhuw

Block E-Mail Addresses 2 years 3 weeks ago #41904

  • gilyboy
  • gilyboy's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
can this array be for *@email.com ?

ie any email that comes from the same @ domain..
I am getting russian bots everyday from the same email domain but the name changes each time,
The administrator has disabled public write access.

Block E-Mail Addresses 2 years 3 weeks ago #41907

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

A "List of Disposable Email Domains" feature is available via main RSForm!Pro configuration where you can include such disallowed domains. Then from the form itself, you'll only need to set the Email Address validation rule on your email textbox.
This is not official customer support. To receive your support, submit a support ticket here.
The administrator has disabled public write access.

Block E-Mail Addresses 10 months 1 week ago #42780

This script works as expected to block individual addresses that repeatedly submit spam. I'm wondering, is there a way to log form submissions that are blocked because of the script? Although I've tested it thoroughly, my concern is that somehow we block a legitimate submission. Currently, there is no way to know what submissions are being blocked. Even though my concern is unlikely to happen, I would feel a lot better if I had some type of logging to look at and see what has been blocked.
The administrator has disabled public write access.

Block E-Mail Addresses 7 months 5 days ago #42915

  • huwhuw
  • huwhuw's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 7
  • Thank you received: 1
If you want to block all email addresses that are not from your domain you can use:
$emailFieldName = 'email';
$validEmailDomain = '@myalloweddomain.com';
 
if(isset($_POST['form'][$emailFieldName])) {
    $enteredEmail = $_POST['form'][$emailFieldName];
 
    // Check if the entered email does not end with the allowed domain
    if (substr($enteredEmail, -strlen($validEmailDomain)) !== $validEmailDomain) {
        $invalid[] = RSFormProHelper::getComponentId($emailFieldName);
    }
}
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!