HEX
Server: Apache
System: Linux hp3-stn-1011028.hostingp3.local 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: csh958633 (951153)
PHP: 8.3.30
Disabled: shell_exec,exec,system,popen,set_time_limit
Upload Files
File: //etc/fail2ban/action.d/postfix-spam.conf
# Fail2ban confiuration file
# Custom mail spam filter - fh

[INCLUDES]

[Definition]

# Option:  actionstart
# Notes.:  command executed once at the start of Fail2Ban.
# Values:  CMD
#
actionstart = touch /etc/postfix/denied_sender
              postmap hash:/etc/postfix/denied_sender

# Option:  actionstop
# Notes.:  command executed once at the end of Fail2Ban
# Values:  CMD
#
actionstop = echo `cat /dev/null` > /etc/postfix/denied_sender
             postmap hash:/etc/postfix/denied_sender

# Option:  actioncheck
# Notes.:  command executed once before each actionban command
# Values:  CMD
#
actioncheck =

# Option:  actionban
# Notes.:  command executed when banning an IP. Take care that the
#          command is executed with Fail2Ban user rights.
# Tags:    See jail.conf(5) man page
# Values:  CMD
#
actionban = uid=<ip>
            user=$(echo $uid)
            echo "csh$user REJECT" >> /etc/postfix/denied_sender
            postmap hash:/etc/postfix/denied_sender
            echo -e "Subject: [Fail2Ban-Mail] $domain Banned\n\nDomain $domain has sent more than 300 mails. Denied $user from sending mail on `uname -n`.\nPlease inform the customer they will be unable to send mail\nTo re-enable:\nfail2ban-client set mail-spam unbanip <ip>\n\n" | sendmail -f linuxadmin@fasthosts.co.uk linuxadmin@fasthosts.co.uk

# Option:  actionunban
# Notes.:  command executed when unbanning an IP. Take care that the
#          command is executed with Fail2Ban user rights.
# Tags:    See jail.conf(5) man page
# Values:  CMD
#
actionunban = uid=<ip>
              user=$(echo $uid)
              sed -i /$user/d /etc/postfix/denied_sender
              postmap hash:/etc/postfix/denied_sender

[Init]