1. Zhang Huangbin
  2. iredapd

Commits

Zhang Huangbin  committed a74a0d0

Extend list of IP addresses.

  • Participants
  • Parent commits ca03b65
  • Branches default

Comments (0)

Files changed (1)

File src/plugins/ldap_domain_wblist.py

View file
     # Get list of restricted ip addresses.
     senderIP = smtpSessionData['client_address']
     (ipf1, ipf2, ipf3, ipf4) = senderIP.split('.')
-    listOfRestrictedIPAddresses = [senderIP,
-                '.'.join([ipf1, '%', ipf3, ipf4]),
-                '.'.join([ipf1, ipf2, '%', ipf4]),
-                '.'.join([ipf1, ipf2, ipf3, '%']),
-               ]
+    listOfRestrictedIPAddresses = [
+        senderIP,                           # xx.xx.xx.xx
+        '.'.join([ipf1, '%.%', ipf4]),      # xx.%.%.xx
+        '.'.join([ipf1, '%', ipf3, ipf4]),  # xx.%.xx.xx
+        '.'.join([ipf1, '%', ipf3, '%']),   # xx.%.xx.%
+        '.'.join([ipf1, '%.%.%']),          # xx.%.%.%
+        '.'.join([ipf1, ipf2, '%', ipf4]),  # xx.xx.%.xx
+        '.'.join([ipf1, ipf2, '%.%']),      # xx.xx.%.%
+        '.'.join([ipf1, ipf2, ipf3, '%']),  # xx.xx.xx.%
+        '%.%.%.%',                          # %.%.%.% Matches all IP addresses.
+    ]
 
     filterOfIPAddr = ''
     for i in listOfRestrictedIPAddresses: