Skip to content

Commit aa05036

Browse files
committed
fix: unique rcptTo in submission call
1 parent 7c92e1e commit aa05036

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mail/mail/doctype/mail_queue/mail_queue.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,7 @@ def _process(self) -> None:
665665
call_id += 1
666666

667667
if not self.save_as_draft:
668+
recipients = list({rcpt["email"] for rcpt in json_loads(self.recipients)})
668669
submission_call = [
669670
"EmailSubmission/set",
670671
{
@@ -684,13 +685,13 @@ def _process(self) -> None:
684685
},
685686
"rcptTo": [
686687
{
687-
"email": rcpt["email"],
688+
"email": rcpt,
688689
"parameters": {
689690
"NOTIFY": "DELAY,FAILURE",
690-
"ORCPT": f"rfc822;{rcpt['email']}",
691+
"ORCPT": f"rfc822;{rcpt}",
691692
},
692693
}
693-
for rcpt in json_loads(self.recipients)
694+
for rcpt in recipients
694695
],
695696
},
696697
}

0 commit comments

Comments
 (0)