{"id":250,"date":"2012-12-14T13:23:47","date_gmt":"2012-12-14T13:23:47","guid":{"rendered":"http:\/\/vickistan.com\/?p=250"},"modified":"2012-12-14T13:24:32","modified_gmt":"2012-12-14T13:24:32","slug":"make-fail2ban-send-emails","status":"publish","type":"post","link":"https:\/\/vickistan.com\/?p=250","title":{"rendered":"Make fail2ban send emails"},"content":{"rendered":"<p>Edit \/etc\/fail2ban\/jail.conf as follows:<\/p>\n<p>action = %(action_)s<\/p>\n<p>gets changed to<\/p>\n<p>action = %(action_mw)s<\/p>\n<p>which causes fail2ban to execute an action shortcut that sends mail:<\/p>\n<p>#########section of jail.conf############################################<br \/>\n# Action shortcuts. To be used to define action parameter<\/p>\n<p># The simplest action to take: ban only<br \/>\naction_ = %(banaction)s[name=%(__name__)s, port=&#8221;%(port)s&#8221;, protocol=&#8221;%(protocol)s&#8221;, chain=&#8221;%(chain)s&#8221;]<\/p>\n<p># ban &#038; send an e-mail with whois report to the destemail.<br \/>\naction_mw = %(banaction)s[name=%(__name__)s, port=&#8221;%(port)s&#8221;, protocol=&#8221;%(protocol)s&#8221;, chain=&#8221;%(chain)s&#8221;]<br \/>\n              %(mta)s-whois[name=%(__name__)s, dest=&#8221;%(destemail)s&#8221;, protocol=&#8221;%(protocol)s&#8221;, chain=&#8221;%(chain)s&#8221;]<\/p>\n<p># ban &#038; send an e-mail with whois report and relevant log lines<br \/>\n# to the destemail.<br \/>\naction_mwl = %(banaction)s[name=%(__name__)s, port=&#8221;%(port)s&#8221;, protocol=&#8221;%(protocol)s&#8221;, chain=&#8221;%(chain)s&#8221;]<br \/>\n               %(mta)s-whois-lines[name=%(__name__)s, dest=&#8221;%(destemail)s&#8221;, logpath=%(logpath)s, chain=&#8221;%(chain)s&#8221;]<\/p>\n<p># Choose default action.  To change, just override value of &#8216;action&#8217; with the<br \/>\n# interpolation to the chosen action shortcut (e.g.  action_mw, action_mwl, etc) in jail.local<br \/>\n# globally (section [DEFAULT]) or per specific section<br \/>\naction = %(action_)s<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Edit \/etc\/fail2ban\/jail.conf as follows: action = %(action_)s gets changed to action = %(action_mw)s which causes fail2ban to execute an action shortcut that sends mail: #########section of jail.conf############################################ # Action shortcuts. To be used to define action parameter # The simplest &hellip; <a href=\"https:\/\/vickistan.com\/?p=250\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-250","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/posts\/250","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vickistan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=250"}],"version-history":[{"count":2,"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/posts\/250\/revisions"}],"predecessor-version":[{"id":252,"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/posts\/250\/revisions\/252"}],"wp:attachment":[{"href":"https:\/\/vickistan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vickistan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vickistan.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}