Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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'

That will tell you if mail is working.

share|improve this answer

Your Answer


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.