title: Use bash script in Fail2Ban Configuration
body: <p>I would like to call a bash script in the mailing of Fail2Ban. The bash script calls a rest api to get the username of the blocked ip-address by fail2ban.</p>
  
  <pre><code># Fail2Ban configuration file
  #
  # Author: *
  #
  #
  
  [INCLUDES]
  
  before = sendmail-common.conf
  
  [Definition]
  
  # Option:  actionban
  # Notes.:  command executed when banning an IP. Take care that the
  #          command is executed with Fail2Ban user rights.
  # Tags:    See jail.conf(5) man page
  # Values:  CMD
  #
  actionban = printf %%b "Subject: [Fail2Ban] &lt;name&gt;: banned &lt;ip&gt; from `uname -n`
              Date: `LC_ALL=C date +"%%a, %%d %%h %%Y %%T %%z"`
              From: &lt;sendername&gt; &lt;&lt;sender&gt;&gt;
              To: &lt;dest&gt;\n
              The following IP &lt;ip&gt; has just been banned by Fail2Ban after &lt;failures&gt; attempts against the acceptance environment of &lt;name&gt; on server.\n
              One or the following users could be the victim: \n 
              `/etc/fail2ban/restapi/getHttpSessions.sh | grep &lt;ip&gt;` \n | /usr/sbin/sendmail -f &lt;sender&gt; &lt;dest&gt;
  
  [Init]
  </code></pre>
  
  <p>But however I got errors in the fail2ban log that no e-mail is sended</p>
  
  <pre><code>`/bin/sh /etc/fail2ban/scripts/getHttpSessions.sh | grep` 10.100.00.00 \n |/usr/sbin/sendmail -f fail2ban test@test.com -- returned 1
  </code></pre>
  
  <p>Is there some way to use a bash script in a fail2ban configuration file that lookups the IP-address in the bash created overview?</p>
  
  <p>Thanks!</p>