mirror of
https://github.com/iredmail/iRedMail
synced 2026-06-08 14:51:59 +00:00
Bypass Amazon EC2 HELO hostnames.
Detect old service before adding missing ones while updating LDAP data for Dovecot 2.3. fixes #121
This commit is contained in:
@@ -106,6 +106,7 @@
|
||||
/^\d{1,3}-\d{1,3}-\d{1,3}-\d{1,3}\.mail-(mail|campmail)\.facebook\.com$/ OK
|
||||
/^outbound-\d{1,3}-\d{1,3}-\d{1,3}-\d{1,3}\.pinterestmail\.com$/ OK
|
||||
/\.outbound\.protection\.outlook\.com$/ OK
|
||||
/^ec2-\d{1,3}-\d{1,3}-\d{1,3}-\d{1,3}\..*\.compute\.amazonaws\.com$/ OK
|
||||
/^out\d{1,3}-\d{1,3}-\d{1,3}-\d{1,3}\.mail\.qq\.com$/ OK
|
||||
|
||||
# reject HELO which contains IP address
|
||||
|
||||
@@ -40,21 +40,15 @@ for (dn, entry) in allUsers:
|
||||
enabledService = entry['enabledService']
|
||||
|
||||
_update = False
|
||||
if b'imaptls' not in enabledService:
|
||||
enabledService += [b'imaptls']
|
||||
_update = True
|
||||
|
||||
if b'pop3tls' not in enabledService:
|
||||
enabledService += [b'pop3tls']
|
||||
_update = True
|
||||
|
||||
if b'smtptls' not in enabledService:
|
||||
enabledService += [b'smtptls']
|
||||
_update = True
|
||||
|
||||
if b'sievetls' not in enabledService:
|
||||
enabledService += [b'sievetls']
|
||||
_update = True
|
||||
# If old service is disabled for the user, then no need to add the new one.
|
||||
for old, new in [(b'imapsecured', b'imaptls'),
|
||||
(b'pop3secured', b'pop3tls'),
|
||||
(b'smtpsecured', b'smtptls'),
|
||||
(b'sievesecured', b'sievetls')]:
|
||||
if (old in enabledService) and (new not in enabledService):
|
||||
enabledService.append(new)
|
||||
_update = True
|
||||
|
||||
if _update:
|
||||
print("* ({} of {}) Updating user: {}".format(count, total, mail))
|
||||
|
||||
Reference in New Issue
Block a user