[Quarantine] Allow to redirect all quarantine messages to a specific address

[Web] Minor changes to quarantine UI
This commit is contained in:
andryyy
2020-07-04 19:31:44 +02:00
parent 94c388bb9c
commit 6c92688ff6
7 changed files with 89 additions and 72 deletions

View File

@@ -86,11 +86,18 @@ def notify_rcpt(rcpt, msg_count, quarantine_acl):
msg.attach(html_part)
msg['To'] = str(rcpt)
bcc = r.get('Q_BCC') or ""
redirect = r.get('Q_REDIRECT') or ""
text = msg.as_string()
if bcc == '':
server.sendmail(msg['From'], str(rcpt), text)
if redirect == '':
server.sendmail(msg['From'], str(rcpt), text)
else:
server.sendmail(msg['From'], str(redirect), text)
else:
server.sendmail(msg['From'], [str(rcpt)] + [str(bcc)], text)
if redirect == '':
server.sendmail(msg['From'], [str(rcpt)] + [str(bcc)], text)
else:
server.sendmail(msg['From'], [str(redirect)] + [str(bcc)], text)
server.quit()
for res in meta_query:
query_mysql('UPDATE quarantine SET notified = 1 WHERE id = "%d"' % (res['id']), update = True)