192 |
- |
1 |
# Fail2Ban filter for exim
|
|
|
2 |
#
|
|
|
3 |
# This includes the rejection messages of exim. For spam and filter
|
|
|
4 |
# related bans use the exim-spam.conf
|
|
|
5 |
#
|
|
|
6 |
|
|
|
7 |
|
|
|
8 |
[INCLUDES]
|
|
|
9 |
|
|
|
10 |
# Read common prefixes. If any customizations available -- read them from
|
|
|
11 |
# exim-common.local
|
|
|
12 |
before = exim-common.conf
|
|
|
13 |
|
|
|
14 |
[Definition]
|
|
|
15 |
|
|
|
16 |
# Fre-filter via "prefregex" is currently inactive because of too different failure syntax in exim-log (testing needed):
|
|
|
17 |
#prefregex = ^%(pid)s <F-CONTENT>\b(?:\w+ authenticator failed|([\w\-]+ )?SMTP (?:(?:call|connection) from|protocol(?: synchronization)? error)|no MAIL in|(?:%(host_info_pre)s\[[^\]]+\]%(host_info_suf)s(?:sender verify fail|rejected RCPT|dropped|AUTH command))).+</F-CONTENT>$
|
|
|
18 |
|
|
|
19 |
failregex = ^%(pid)s %(host_info)ssender verify fail for <\S+>: (?:Unknown user|Unrouteable address|all relevant MX records point to non-existent hosts)\s*$
|
|
|
20 |
^%(pid)s \w+ authenticator failed for (?:[^\[\( ]* )?(?:\(\S*\) )?\[<HOST>\](?::\d+)?(?: I=\[\S+\](:\d+)?)?: 535 Incorrect authentication data( \(set_id=.*\)|: \d+ Time\(s\))?\s*$
|
|
|
21 |
^%(pid)s %(host_info)srejected RCPT [^@]+@\S+: (?:relay not permitted|Sender verify failed|Unknown user|Unrouteable address)\s*$
|
|
|
22 |
^%(pid)s SMTP protocol synchronization error \([^)]*\): rejected (?:connection from|"\S+") %(host_info)s(?:next )?input=".*"\s*$
|
|
|
23 |
^%(pid)s SMTP call from (?:[^\[\( ]* )?%(host_info)sdropped: too many (?:nonmail commands|syntax or protocol errors) \(last (?:command )?was "[^"]*"\)\s*$
|
|
|
24 |
^%(pid)s SMTP protocol error in "[^"]+(?:"+[^"]*(?="))*?" %(host_info)sAUTH command used when not advertised\s*$
|
|
|
25 |
^%(pid)s no MAIL in SMTP connection from (?:[^\[\( ]* )?(?:\(\S*\) )?%(host_info)sD=\d\S*s(?: C=\S*)?\s*$
|
|
|
26 |
^%(pid)s (?:[\w\-]+ )?SMTP connection from (?:[^\[\( ]* )?(?:\(\S*\) )?%(host_info)sclosed by DROP in ACL\s*$
|
|
|
27 |
<mdre-<mode>>
|
|
|
28 |
|
|
|
29 |
mdre-aggressive = ^%(pid)s no host name found for IP address <HOST>$
|
|
|
30 |
^%(pid)s no IP address found for host \S+ \(during SMTP connection from \[<HOST>\]\)$
|
|
|
31 |
|
|
|
32 |
mdre-normal =
|
|
|
33 |
|
|
|
34 |
# Parameter `mode` - `normal` or `aggressive`.
|
|
|
35 |
# Aggressive mode can be used to match flood and ddos-similar log-entries like:
|
|
|
36 |
# 'no host found for IP', 'no IP found for host'.
|
|
|
37 |
# Note this is not an authentication failures, so it may produce lots of false
|
|
|
38 |
# positives on misconfigured MTAs.
|
|
|
39 |
# Ex.:
|
|
|
40 |
# filter = exim[mode=aggressive]
|
|
|
41 |
mode = normal
|
|
|
42 |
|
|
|
43 |
ignoreregex =
|
|
|
44 |
|
|
|
45 |
# DEV Notes:
|
|
|
46 |
# The %(host_info) defination contains a <HOST> match
|
|
|
47 |
#
|
|
|
48 |
# SMTP protocol synchronization error \([^)]*\) <- This needs to be non-greedy
|
|
|
49 |
# to void capture beyond ")" to avoid a DoS Injection vulnerabilty as input= is
|
|
|
50 |
# user injectable data.
|
|
|
51 |
#
|
|
|
52 |
# Author: Cyril Jaquier
|
|
|
53 |
# Daniel Black (rewrote with strong regexs)
|
|
|
54 |
# Martin O'Neal (added additional regexs to detect authentication failures, protocol errors, and drops)
|