Skip to content

Commit

Permalink
Merge pull request #28 from Oefenweb/sender-sendername
Browse files Browse the repository at this point in the history
Add support for the sender and sendername variables
  • Loading branch information
tersmitten committed May 30, 2016
2 parents 9c58667 + c3d66d8 commit aff736b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ None
- `fail2ban_maxretry`: [default: `3`]: Maximum number of retries before the host is put into jail
- `fail2ban_findtime`: [default: `600`]: A host is banned if it has generated `fail2ban_maxretry` during the last `fail2ban_findtime` (this can be overriden for each service)
- `fail2ban_backend`: [default: `auto`]: Specifies the backend used to get files modification
- `fail2ban_email`: [default: `root@localhost`]: Email address which can be used in the interpolation of the `fail2ban_services`
- `fail2ban_banaction`: [default: `iptables-multiport`]: Sets the global/default banaction (can be overriden on a per role basis)
- `fail2ban_mta`: [default: `sendmail`]: Email action
- `fail2ban_protocol`: [default: `tcp`]: Sets the default protocol
- `fail2ban_chain`: [default: `INPUT`]: Specifies the chain where jumps would need to be added in iptables-* actions
- `fail2ban_action`: [default: `action_`]: Default action
- `fail2ban_sendername`: [default: `Fail2ban`]: The 'from' name for emails sent by mta actions. NB: Use `fail2ban_sender` to set the 'from' email address.

- `fail2ban_sender`: [optional]: The 'from' address for emails sent by mta actions.
- `fail2ban_filterd_path`: [optional]: Path to directory containing filters to copy (**note the trailing slash**)
- `fail2ban_actiond_path`: [optional]: Path to directory containing actions to copy (**note the trailing slash**)
- `fail2ban_jaild_path`: [optional]: Path to directory containing jails to copy (**note the trailing slash**)
Expand Down
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ fail2ban_syslog_facility: 1
fail2ban_socket: /var/run/fail2ban/fail2ban.sock
fail2ban_pidfile: /var/run/fail2ban/fail2ban.pid

fail2ban_sendername: 'Fail2ban'

fail2ban_ignoreips:
- 127.0.0.1/8
fail2ban_bantime: 600
Expand Down
8 changes: 8 additions & 0 deletions templates/etc/fail2ban/jail.local.j2
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ backend = {{ fail2ban_backend }}
# jail.{conf,local} configuration files.
destemail = {{ fail2ban_destemail }}

#
# Sender name and email address used solely for the interpolations in
# jail.{conf,local} configuration files.
sendername = {{ fail2ban_sendername }}
{% if fail2ban_sender is defined %}
sender = {{ fail2ban_sender }}
{% endif %}

#
# ACTIONS
#
Expand Down

0 comments on commit aff736b

Please sign in to comment.