Advertisement
Guest User

sendmail-buffered.conf

a guest
Jul 6th, 2012
224
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Fail2Ban configuration file
  2. #
  3. # Author: David Carlos Manuelda <stormbyte@gmail.com>
  4. # Based on mail-buffered.conf by Cyril Jaquier
  5. # $Revision$
  6. #
  7.  
  8. [Definition]
  9.  
  10. # Option: actionstart
  11. # Notes.: command executed once at the start of Fail2Ban.
  12. # Values: CMD
  13. #
  14. actionstart = printf %%b "Subject: [Fail2Ban] <name>: started
  15. From: Fail2Ban <<sender>>
  16. To: <dest>\n
  17. Hi,\n
  18. The jail <name> has been started successfully.\n
  19. Output will be buffered until <lines> lines are available.\n
  20. Regards,\n
  21. Fail2Ban" | /usr/sbin/sendmail -f <sender> <dest>
  22.  
  23. # Option: actionstop
  24. # Notes.: command executed once at the end of Fail2Ban
  25. # Values: CMD
  26. #
  27. actionstop = if [ -f <tmpfile> ]; then
  28. printf %%b "Subject: [Fail2Ban] <name>: summary
  29. From: Fail2Ban <<sender>>
  30. To: <dest>\n
  31. Hi,\n
  32. These hosts have been banned by Fail2Ban.\n
  33. `cat <tmpfile>`
  34. Regards,\n
  35. Fail2Ban" | /usr/sbin/sendmail -f <sender> <dest>
  36. rm <tmpfile>
  37. fi
  38. printf %%b "Subject: [Fail2Ban] <name>: stopped
  39. From: Fail2Ban <<sender>>
  40. To: <dest>\n
  41. Hi,\n
  42. The jail <name> has been stopped.\n
  43. Regards,\n
  44. Fail2Ban" | /usr/sbin/sendmail -f <sender> <dest>
  45.  
  46. # Option: actioncheck
  47. # Notes.: command executed once before each actionban command
  48. # Values: CMD
  49. #
  50. actioncheck =
  51.  
  52. # Option: actionban
  53. # Notes.: command executed when banning an IP. Take care that the
  54. # command is executed with Fail2Ban user rights.
  55. # Tags: <ip> IP address
  56. # <failures> number of failures
  57. # <time> unix timestamp of the ban time
  58. # Values: CMD
  59. #
  60. actionban = printf %%b "`date`: <ip> (<failures> failures)\n" >> <tmpfile>
  61. LINE=$( wc -l <tmpfile> | awk '{ print $1 }' )
  62. if [ $LINE -ge <lines> ]; then
  63. printf %%b "Subject: [Fail2Ban] <name>: summary
  64. From: Fail2Ban <<sender>>
  65. To: <dest>\n
  66. Hi,\n
  67. These hosts have been banned by Fail2Ban.\n
  68. `cat <tmpfile>`
  69. Regards,\n
  70. Fail2Ban" | /usr/sbin/sendmail -f <sender> <dest>
  71. rm <tmpfile>
  72. fi
  73.  
  74. # Option: actionunban
  75. # Notes.: command executed when unbanning an IP. Take care that the
  76. # command is executed with Fail2Ban user rights.
  77. # Tags: <ip> IP address
  78. # <failures> number of failures
  79. # <time> unix timestamp of the ban time
  80. # Values: CMD
  81. #
  82. actionunban =
  83.  
  84. [Init]
  85.  
  86. # Defaut name of the chain
  87. #
  88. name = default
  89.  
  90. # Destination/Addressee of the mail
  91. #
  92. dest = root
  93.  
  94. # Sender of the mail
  95. #
  96. sender = fail2ban
  97.  
  98. # Default number of lines that are buffered
  99. #
  100. lines = 50 # Send mail when 50 IPs are already banned
  101.  
  102. # Default temporary file
  103. #
  104. tmpfile = /var/run/fail2ban/tmp-mail.txt
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement