From e1b919366e1c30e5b4a8fb4cd3e64a7fa493eff8 Mon Sep 17 00:00:00 2001 From: "Thomas C." <56068416+Thomas905@users.noreply.github.com> Date: Wed, 1 Oct 2025 19:18:31 +0200 Subject: [PATCH] FIX : To have only the sender's entity when sending mail (#31053) * fix * Update html.formmail.class.php * Update html.formmail.class.php --------- Co-authored-by: Laurent Destailleur Co-authored-by: lvessiller-opendsi --- htdocs/core/class/html.formmail.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 49669a4c02c..c54bdab2949 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -627,7 +627,7 @@ class FormMail extends Form // Add also email aliases from the c_email_senderprofile table $sql = "SELECT rowid, label, email FROM ".$this->db->prefix()."c_email_senderprofile"; - $sql .= " WHERE active = 1 AND (private = 0 OR private = ".((int) $user->id).")"; + $sql .= " WHERE active = 1 AND (private = 0 OR private = ".((int) $user->id).") AND entity in getEntity('c_email_senderprofile')"; $sql .= " ORDER BY position"; $resql = $this->db->query($sql); if ($resql) {