Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have configured fail2ban but I would like to test sending of email. For example, I would like that I get email when fail2ban is started or stopped.

share|improve this question
add comment

1 Answer

My understanding is that fail2ban can be configured to send email notifications when hosts which appear to be attacking the system are detected. If you need to test this, and have access to another system you don't mind being banned from, simply try to log in incorrectly a few too many times (to exceed your configured threshold).

Before doing this, I would suggest confirming that mail works from the commandline to begin with, since fail2ban is just configured to use an mta (probably sendmail, or postfix's sendmail binary):

echo "test message" | mailx -s 'test subject' myemail@mydomain.com

That will tell you if mail is working.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.