Forums

Block IP addresses from sending emails

geetech 04 Aug, 2009
Is there a way to block certain ip addresses from sending emails via chronoforms. I keep getting spam from a certain ip addresses. I do not want to turn on image verification, because my users have trouble using it.


So, is there a way to block this ip address; 94.102.63.15, they keep spamming my inbox.

Thanks.
geetech 05 Aug, 2009
I now have 26 new messages from this same ip address. How do I block this?
nml375 05 Aug, 2009
Hi,
You could use the Serverside Validation for this, something like this should do the trick:
<?
if ($_SERVER['REMOTE_ADDR'] == '94.102.63.15')
{
  return "You are not authorized to use this service!";
}
?>


You might also consider using some blacklist plugins that checks lists such as DNS RBL, which would protect your whole joomla installation. A word of caution here though, is that if you use improper blacklist, you might end up banning your intended users.

Edit: Should be REMOTE_ADDR, not SERVER_ADDR.
/Fredrik
geetech 05 Aug, 2009
So under validation, ServerSide Validation, I just enter the above code? and have Enable Server Side Validation set to Yes?

Is anything else require?

Thank you so much by the way, hopefully if this works I can stop getting spammed by this person or bot. 😀
nml375 05 Aug, 2009
Yep, that should be sufficient (at least until your nemesis changes his or her IP).

/Fredrik
geetech 07 Aug, 2009
Thanks the support was first class.
geetech 31 Aug, 2009
If I have more than one IP address that is spamming my emails would I do the following;
<?
if ($_SERVER['REMOTE_ADDR'] == '94.102.63.15', '58.27.140.58', '72.3.224.55')
{
  return "You are not authorized to use this service!";
}
?>
GreyHead 31 Aug, 2009
Hi geetech,

Nearly
<?
if ( in_array($_SERVER['REMOTE_ADDR'], array('94.102.63.15', '58.27.140.58', '72.3.224.55') ) ) {
  return "You are not authorized to use this service!";
}
?>
should do it.

Bob
geetech 17 Sep, 2009

Hi geetech,

Nearly

<?
if ( in_array($_SERVER['REMOTE_ADDR'], array('94.102.63.15', '58.27.140.58', '72.3.224.55') ) ) {
  return "You are not authorized to use this service!";
}
?>
should do it.

Bob


😀 😀 😀

Thats why I paid the fee, the service is first class. Thanks
phaseolus 22 Dec, 2011
Hi, sorry by reopen a old post, but, whats file in joomla I need edit for agree this code lines ??
Thanks.
GreyHead 22 Dec, 2011
Hi phaseolus,

This was code for the ServerSide validation box in ChronoForms v3.

Bob
Tonk 27 Feb, 2013
I also need to block some IP numbers from spamming
Can you be more specific in where to enter the mentioned code in the current version of Chronoforms?

tanx
GreyHead 27 Feb, 2013
Hi Tonk,

I'd use something like this in a Custom Code action at the beginning of the On Submit event:
<?
if ( in_array($_SERVER['REMOTE_ADDR'], array('94.102.63.15', '58.27.140.58', '72.3.224.55') ) ) {
  $mainframe =& JFactory::getApplication();
  $mainframe->redirect('http://yahoo.com');
}
?>
And replace yahoo.com with the redirection URL of your choice.

Bob
This topic is locked and no more replies can be posted.