mirror of
https://github.com/marcus-alicia/iRedAdmin-Pro-SQL.git
synced 2026-05-26 15:13:38 +00:00
Add files via upload
This commit is contained in:
28
libs/iredapd/utils.py
Normal file
28
libs/iredapd/utils.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# Author: Zhang Huangbin <zhb@iredmail.org>
|
||||
|
||||
from libs import iredutils
|
||||
from libs.iredapd import throttle as iredapd_throttle
|
||||
from libs.iredapd import greylist as iredapd_greylist
|
||||
|
||||
|
||||
def delete_settings_for_removed_users(mails):
|
||||
try:
|
||||
iredapd_greylist.delete_settings_for_removed_users(mails=mails)
|
||||
iredapd_throttle.delete_settings_for_removed_users(mails=mails)
|
||||
|
||||
return True,
|
||||
except Exception as e:
|
||||
return False, repr(e)
|
||||
|
||||
|
||||
def delete_settings_for_removed_domains(domains):
|
||||
domains = [str(d).lower() for d in domains if iredutils.is_domain(d)]
|
||||
|
||||
if not domains:
|
||||
return True,
|
||||
|
||||
for d in domains:
|
||||
iredapd_throttle.delete_settings_for_removed_domain(domain=d)
|
||||
iredapd_greylist.delete_settings_for_removed_domain(domain=d)
|
||||
|
||||
return True,
|
||||
Reference in New Issue
Block a user