Per-domain and per-user greylisting whitelists updates should not delete data from "iredapd.greylisting_whitelist_domains", but it happens. (DELETE FROM greylisting_whitelist_domains WHERE 1=1)
MariaDB queries log:
160210 19:26:11 43 Connect iredadmin@localhost as anonymous on iredadmin
43 Query SET NAMES utf8
43 Query set autocommit=0
43 Query SELECT * FROM sessions WHERE session_id='157f1687a9f238098c33b1de0f096f13c92e700c'
43 Query commit
43 Query SELECT * FROM sessions WHERE session_id='157f1687a9f238098c33b1de0f096f13c92e700c'
43 Query commit
43 Query UPDATE sessions SET atime = '2016-02-10 19:26:11' WHERE session_id='157f1687a9f238098c33b1de0f096f13c92e700c'
43 Query commit
44 Connect iredapd@localhost as anonymous on iredapd
44 Query SET NAMES utf8
44 Query set autocommit=0
44 Query DELETE FROM greylisting WHERE account = '@lexample.com' AND sender = '@.'
44 Query commit
44 Query INSERT INTO greylisting (priority, active, account, sender, sender_priority) VALUES (60, 0, '@lexample.com', '@.', 0)
44 Query SELECT last_insert_id()
44 Query commit
44 Query DELETE FROM greylisting_whitelist_domains WHERE 1=1
44 Query commit
44 Query DELETE FROM greylisting_whitelists WHERE account = '@lexample.com'
44 Query commit
44 Quit
43 Query SELECT * FROM sessions WHERE session_id='157f1687a9f238098c33b1de0f096f13c92e700c'
43 Query commit
libs/ldaplib/domain.py
# Update domain profile.
# data = web.input()
def update(self, profile_type, domain, form):
.....
elif profile_type == 'greylisting':
if session.get('enable_iredapd'):
qr = iredapd_greylist.update_greylist_settings_from_form(account='@' + self.domain, form=form)
return qr
libs/ldaplib/user.py
def update(self, profile_type, mail, form):
.....
elif profile_type == 'greylisting':
if session.get('enable_iredapd'):
qr = iredapd_greylist.update_greylist_settings_from_form(account=mail, form=form)
return qr
libs/iredapd/greylist.py
def update_greylist_settings_from_form(account, form):
.....
qr = gl.update_greylist_whitelist_domains(domains=wl_domains)
if not qr[0] is True:
return qr
return q
libs/iredapd/greylist.py
def update_greylist_whitelist_domains(self, domains=None):
"""Update greylisting whitelist domains for specified account.
domains -- must be a iterable object. e.g. list, tuple."""
# Delete existing records first
try:
self.db.delete('greylisting_whitelist_domains', where='1=1')
except Exception, e:
return (False, str(e))