diff --git a/config/action.d/common.conf b/config/action.d/common.conf new file mode 100644 index 00000000..6d69019c --- /dev/null +++ b/config/action.d/common.conf @@ -0,0 +1,11 @@ +[INCLUDES] + +# Load customizations if any available +after = common.local + +[DEFAULT] + +_LC_CTYPE = `locale | awk -F= '/LC_CTYPE/{ print $2; }'` + +# To avoid duplication -- define useful header fields +_ContentTypeMailHeader = Content-Type: text/plain; charset=%(_LC_CTYPE)s diff --git a/config/action.d/sendmail-whois-lines.conf b/config/action.d/sendmail-whois-lines.conf index d1e6e40f..7340d3cd 100644 --- a/config/action.d/sendmail-whois-lines.conf +++ b/config/action.d/sendmail-whois-lines.conf @@ -2,17 +2,25 @@ # # Author: Cyril Jaquier # -# $Revision$ -# + +[INCLUDES] + +# Read common prefixes. If any customizations available -- read them from +# common.local +before = common.conf [Definition] +# To avoid duplication -- define variable for the content-type +ContentType = Content-Type: text/plain; charset=`locale | awk -F= '/LC_CTYPE/{ print $2; }'` + # Option: actionstart # Notes.: command executed once at the start of Fail2Ban. # Values: CMD # actionstart = printf %%b "Subject: [Fail2Ban] : started Date: `date -u +"%%a, %%d %%h %%Y %%T +0000"` + %(_ContentTypeMailHeader)s From: Fail2Ban <> To: \n Hi,\n @@ -26,6 +34,7 @@ actionstart = printf %%b "Subject: [Fail2Ban] : started # actionstop = printf %%b "Subject: [Fail2Ban] : stopped Date: `date -u +"%%a, %%d %%h %%Y %%T +0000"` + %(_ContentTypeMailHeader)s From: Fail2Ban <> To: \n Hi,\n @@ -49,6 +58,7 @@ actioncheck = # actionban = printf %%b "Subject: [Fail2Ban] : banned Date: `date -u +"%%a, %%d %%h %%Y %%T +0000"` + %(_ContentTypeMailHeader)s From: Fail2Ban <> To: \n Hi,\n diff --git a/config/action.d/sendmail-whois.conf b/config/action.d/sendmail-whois.conf index 363c3398..724b2511 100644 --- a/config/action.d/sendmail-whois.conf +++ b/config/action.d/sendmail-whois.conf @@ -5,6 +5,12 @@ # $Revision$ # +[INCLUDES] + +# Read common prefixes. If any customizations available -- read them from +# common.local +before = common.conf + [Definition] # Option: actionstart @@ -13,6 +19,7 @@ # actionstart = printf %%b "Subject: [Fail2Ban] : started Date: `date -u +"%%a, %%d %%h %%Y %%T +0000"` + %(_ContentTypeMailHeader)s From: Fail2Ban <> To: \n Hi,\n @@ -26,6 +33,7 @@ actionstart = printf %%b "Subject: [Fail2Ban] : started # actionstop = printf %%b "Subject: [Fail2Ban] : stopped Date: `date -u +"%%a, %%d %%h %%Y %%T +0000"` + %(_ContentTypeMailHeader)s From: Fail2Ban <> To: \n Hi,\n @@ -49,6 +57,7 @@ actioncheck = # actionban = printf %%b "Subject: [Fail2Ban] : banned Date: `date -u +"%%a, %%d %%h %%Y %%T +0000"` + %(_ContentTypeMailHeader)s From: Fail2Ban <> To: \n Hi,\n