Fail2Ban and PostFix Mail.Warn Error

I keep getting a weird error where Fail2Ban refuses to start due to a bad log location. It looks like this: fail2ban-client[##]: ERROR No file(s) found for glob /var/log/mail.warn

Looking at /var/log/, there are no mail.warn logs. PostFix only logs to mail.log and mail.err.

So what to do is to edit the jail.conf or other local jail files to point to the mail.log and mail.err files, although whichever the actual, correct log file to use is not clear for me.

Anyway, here is the code:

  1. Edit: sudo nano /etc/fail2ban/jail.conf
  2. Find and comment out: #logpath = %(postfix_log)s
  3. Insert: logpath = /var/log/mail.err

Then restart Fail2Ban (sudo service fail2ban restart) and this time it will hopefully work. Whether it works effectively or not will be affected by the choice of log files, I guess.

References: 1

Fail2Ban and PostFix Mail.Warn Error
Scroll to top