如何全域設定fail2ban電子郵件目的地

如何全域設定fail2ban電子郵件目的地

我希望fail2ban 向我發送任何事件的警報電子郵件。/etc/fail2ban和中的設定檔中似乎散佈著 dest 變數/etc/fail2ban/action.d

有沒有辦法為所有事件設定一個目標電子郵件?我似乎找不到這方面的最新文件。

jam.local 包含:

# ban & send an e-mail with whois report to the destemail.
action_mw = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
            %(mta)s-whois[name=%(__name__)s, dest="%(destemail)s", protocol="%(protocol)s", chain="%(chain)s"]

但在哪裡destemail設定呢?了解如何快速測試是否正常運作也很有用destemail

答案1

看起來它在/etc/fail2ban/jail.local(在 centos 6.7 上)中,它是從jail.conf.

測試郵件投遞是否正常的單行郵件將是

echo "My message" | mail -s subject [email protected]

相關內容