0

Running Ubuntu 16.04 OS Nginx server Fail2Ban Ver 0.9.3

When I first did the install of fail2ban i believe it asked me for an email address.

well, I put in my personal email and I get spammed with all the ips getting banned. I dont mind it but i want to change the email address it has. But, I'm unable to locate the correct file where i can change the email address it's sending too.

what is the filename I need to edit? what directory is this file in?

Please help

Thanks, Ronnie

Ronnie
  • 21
  • 4

1 Answers1

1

You should be able to change the email address within the jail.conf

I use centos, but you should be able to search and find the same file.

/etc/fail2ban/jail.conf

#Sender email address used solely for some actions

sender = root@localhost

xguru
  • 193
  • 1
  • 7
  • when i do service fail2ban status I actually see my real email address not root@localhost I'm looking to change the email address that fail2ban sends too – Ronnie Aug 05 '16 at 15:11
  • I'm sorry what about "service fail2ban status"? – xguru Aug 05 '16 at 15:14
  • output from the status command where it has my_real_address@xxxx.com this is where it's show my real email address to=MYREALEMAIL@X.COM, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30205, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (u75F8doN010195 Message accepted for delivery) from=fail2ban, size=227, class=0, nrcpts=1, msgid=<201608051508.u75F8ewW010206@my.server.com>, relay=root@localhost to=MYREALEMAIL@X.COM, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30240, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (u75F8fAK010271 Message accepted for delivery) – Ronnie Aug 05 '16 at 15:18
  • Yup, so like i said, you need to edit your jail.conf. In that file you will find sender = my_real_address@xxxx.com. Change it to whatever you like and restart the service. – xguru Aug 05 '16 at 15:23
  • I edited the jail.conf file to my_real_address@xxxx.com and I did sudo service fail2ban restart and still getting emails to my personal email address :( – Ronnie Aug 05 '16 at 15:49
  • Ok, i had to login to the control panel of my domain and check and allow emails from fail2ban not to go to spam folder - I'm getting the emails to the correct email address I want now but, for some reason I'm not getting any emails on on the ip address and the detailed info that I use to get – Ronnie Aug 05 '16 at 15:57
  • sounds like a different topic from the original question. Might need to start a new thread and included the needed information to help. i.e. what you saw before, any changes you made and what you see now. – xguru Aug 05 '16 at 16:07