From bdbb0c34bef212808bdd4e863dd16ddcfb17a8c7 Mon Sep 17 00:00:00 2001 From: andryyy Date: Tue, 26 May 2020 20:03:40 +0200 Subject: [PATCH] [Dovecot] Fix invalid rcpt when no bcc is set, fixes #3576 --- data/Dockerfiles/dovecot/quarantine_notify.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/data/Dockerfiles/dovecot/quarantine_notify.py b/data/Dockerfiles/dovecot/quarantine_notify.py index b1e805ec..59e3e660 100755 --- a/data/Dockerfiles/dovecot/quarantine_notify.py +++ b/data/Dockerfiles/dovecot/quarantine_notify.py @@ -86,7 +86,10 @@ def notify_rcpt(rcpt, msg_count, quarantine_acl): msg['To'] = str(rcpt) bcc = r.get('Q_BCC') or "" text = msg.as_string() - server.sendmail(msg['From'], [str(rcpt)] + [str(bcc)], text) + if bcc == '': + server.sendmail(msg['From'], str(rcpt), text) + else: + server.sendmail(msg['From'], [str(rcpt)] + [str(bcc)], text) server.quit() for res in meta_query: query_mysql('UPDATE quarantine SET notified = 1 WHERE id = "%d"' % (res['id']), update = True)