diff --git a/fail2ban/server/filter.py b/fail2ban/server/filter.py
index 98c28e35..0c44c7ac 100644
--- a/fail2ban/server/filter.py
+++ b/fail2ban/server/filter.py
@@ -883,6 +883,7 @@ class Filter(JailThread):
fid = failRegex.getFailID()
host = fid
cidr = IPAddr.CIDR_RAW
+ raw = True
# if mlfid case (not failure):
if host is None:
if ll <= 7: logSys.log(7, "No failure-id by mlfid %r in regex %s: %s",
diff --git a/fail2ban/tests/fail2banregextestcase.py b/fail2ban/tests/fail2banregextestcase.py
index 05db2a24..0c2f2901 100644
--- a/fail2ban/tests/fail2banregextestcase.py
+++ b/fail2ban/tests/fail2banregextestcase.py
@@ -182,6 +182,15 @@ class Fail2banRegexTest(LogCaptureTestCase):
)
self.assertTrue(fail2banRegex.start(args))
self.assertLogged('Lines: 19 lines, 0 ignored, 13 matched, 6 missed')
+ # usage of \S+ causes raw handling automatically:
+ self.pruneLog()
+ (opts, args, fail2banRegex) = _Fail2banRegex(
+ "-d", "^Epoch",
+ "1490349000 test failed.dns.ch", "^\s*test \S+"
+ )
+ self.assertTrue(fail2banRegex.start(args))
+ self.assertLogged('Lines: 1 lines, 0 ignored, 1 matched, 0 missed', all=True)
+ self.assertNotLogged('Unable to find a corresponding IP address')
def testDirectRE_2(self):
(opts, args, fail2banRegex) = _Fail2banRegex(