Page 1 of 1
No permanent block if country = Canada
Posted: 16 Apr 2017, 21:39
by cglmicro
Hi again.
I also wonder if it's possible NOT to block permanent (could block temporary) when the country of an IP is mine (Canada) and a rule is triggered? This way, it would have way less impact on my customer that keeps forgetting their password.
Re: No permanent block if country = Canada
Posted: 17 Apr 2017, 20:09
by Sergio
You can create a shebang file to unblock all Canadian IPs and then do a cron job for that file to run every 15 minutes. Also, you should avoid to unblock specific funtions like EXIM errors as an example.
Sergio
Re: No permanent block if country = Canada
Posted: 17 Apr 2017, 21:11
by cglmicro
Ok !! It look way more complicated that what I had in mind.
A quick search show me that there is around 1700 blocks of IP address in Canada (
http://www.nirsoft.net/countryip/ca.html). The script would have to go through each line and compare them to each line in the error log...
Thanks anyway for this answer.
Re: No permanent block if country = Canada
Posted: 18 Apr 2017, 01:59
by Sergio
No, you don't have to check all of the 1700 blocks of Canada's IPs.
What you should do is to go to the csf.deny file and do a grep for the name of the country "Canada", As you can see csf.deny already has the country name on each blocked IP.
With the grep you will have all the IPs that were blocked in the last 15 minutes and I don't think it will be hundred of them. In my servers there are only one or two IPs blocked and not each hour, but that depends on your customers.
Also, you can set CSF MESSENGER and add the new option reCaptcha, so, your own customers can unblock by their selves.
I have both options, the cron and the recaptcha and they are working great..