Do not print a log warning for IPs in local mailcow network to prevent watchdog spam in the log

This commit is contained in:
Thorbjörn Jörger 2023-04-13 12:56:32 +02:00
parent ed9b239af7
commit af5f5cc9e2
No known key found for this signature in database
GPG Key ID: 82701519391A1DCD
1 changed files with 2 additions and 0 deletions

View File

@ -342,6 +342,8 @@ def watch():
logInfo('Check if your regular expressions are up to date: https://github.com/mailcow/mailcow-dockerized/issues/5125') logInfo('Check if your regular expressions are up to date: https://github.com/mailcow/mailcow-dockerized/issues/5125')
continue continue
ip = ipaddress.ip_address(addr) ip = ipaddress.ip_address(addr)
if ip in ipaddress.ip_network(os.getenv('IPV4_NETWORK', '172.22.1') + '.0/24') or ip in ipaddress.ip_network(os.getenv('IPV6_NETWORK', 'fd4d:6169:6c63:6f77::/64')):
continue
if ip.is_private or ip.is_loopback: if ip.is_private or ip.is_loopback:
logWarn('%s matched rule id: %s, log line: %s´, but was ignored as it is a private or loopback IP' % (addr, rule_id, item['data'])) logWarn('%s matched rule id: %s, log line: %s´, but was ignored as it is a private or loopback IP' % (addr, rule_id, item['data']))
continue continue