Apache mod_evasive issues

3.1k Views Asked by At

I am using the mod_evasive apache module for my website and it seems to work just fine. Since you can specify in the config to run an external command when a rule is triggered I have added something like

DOSEmailNotify    my_email<br/>
DOSSystemCommand  "sudo /usr/bin/perl /etc/csf/csf.pl --tempdeny %s 300 -d in"<br/>
DOSLogDir         "/var/log/httpd/mod_evasive"

Everything works fine but the email I receive has sender nobody and no subject and the body looks like this:

To: my_email
Subject: HTTP BLACKLIST 83.166.209.41
mod_evasive HTTP Blacklisted 83.166.209.41

Is there anyway I can configure mod_evasive with a custom from address and also a custom subject?

1

There are 1 best solutions below

0
On

you could use the DOSSystemCommand instead of DOSEmailNotify:

 DOSSystemCommand   "echo 'mod_evasive HTTP Blacklisted %s more info here: www.projecthoneypot.org/ip_%s' | mail -s 'Blocked IP by mod_evasive' root@localhost"