在Fail2ban中,我已经将我的电子邮件设置设置为:
# Destination email address used solely for the interpolations in # jail.{conf,local} configuration files. destemail = [email protected] # # Name of the sender for mta actions sendername = [email protected] # Email address of the sender sender = [email protected]
我已经在我的/etc/fail2ban/jail.local和/etc/fail2ban/jail.conf文件中设置了这个,但是当我查看我的Mailgun域日志时,我看到由于没有被RFC 5322。
当我查看Mailgun日志中的邮件标题时,可以看到:
"message": { "headers": { "to": "root", "message-id": "[email protected]", "from": "Fail2Ban <fail2ban>", "subject": "[Fail2Ban] recidive: banned 183.3.202.174 from example.com" },
我有一个规则设置发送任何电子邮件的根到我的电子邮件地址。
为什么没有将它们发送到正确的电子邮件地址,我如何解决这个问题/使电子邮件符合RFC 5322?
服务器信息
Fail2Ban v0.8.13 如果您需要更多信息,请让我知道
消息: 根
来自: Fail2ban
看起来像您的SMTP重写或别名不能正常工作。
我会开始在那里检查
编辑没有进一步的细节,我很难说 – 但听起来你可能有一个configuration问题与sSMTP
为什么selectsSMTP?
Fail2ban支持两个MTA。
添加这个
# E-mail action. Since 0.8.1 Fail2Ban uses sendmail MTA for the # mailing. Change mta configuration parameter to mail if you want to # revert to conventional 'mail'. mta = sendmail
这里
/etc/fail2ban/jail.local
另一个有用的提示是确保您的variables名称是正确的….
我拉着头发,直到我意识到我正在使用…
destmail = [email protected]
而不是正确的
destemail = [email protected]
仔细观察,你会看到这些值被传递给action.d中定义的动作。
例如,
**action_mwl = ....., dest="%(destemail)s, ....**
所以是的,不要覆盖动作文件中的dest。