From 14772c3a204b14d3249936d56873a82a3870d47e Mon Sep 17 00:00:00 2001 From: Stephen Ritz <127270018+smpaz7467@users.noreply.github.com> Date: Tue, 14 Jul 2026 16:36:40 -0700 Subject: [PATCH] [Web] return sender_acl in get/mailbox API sender_acl can be set through edit/mailbox but was never returned by get/mailbox, so an API client could not read back what it had written, and get/mailbox/all / get/mailbox/{mailbox} both omitted it. Add the mailbox's internal send-as ACL (the sender_acl table rows with external = 0) to mailbox_details as sender_acl, an array of send_as values, mirroring the field edit/mailbox accepts. It is added in the same block as the other detailed fields, so the lightweight get/mailbox/reduced endpoint is unaffected. Fixes #7011 Co-Authored-By: Claude Opus 4.8 (1M context) --- data/web/inc/functions.mailbox.inc.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/data/web/inc/functions.mailbox.inc.php b/data/web/inc/functions.mailbox.inc.php index a9f17705d..ba2756a4f 100644 --- a/data/web/inc/functions.mailbox.inc.php +++ b/data/web/inc/functions.mailbox.inc.php @@ -5320,6 +5320,14 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { $mailboxdata['rl_scope'] = 'domain'; } $mailboxdata['is_relayed'] = $row['backupmx']; + // Internal send-as ACL for this mailbox, mirrors the sender_acl field accepted by edit/mailbox + $mailboxdata['sender_acl'] = array(); + $stmt = $pdo->prepare("SELECT `send_as` FROM `sender_acl` WHERE `logged_in_as` = :username AND `external` = '0'"); + $stmt->execute(array(':username' => $_data)); + $sender_acl_rows = $stmt->fetchAll(PDO::FETCH_ASSOC); + foreach ($sender_acl_rows as $sender_acl_row) { + $mailboxdata['sender_acl'][] = $sender_acl_row['send_as']; + } } $stmt = $pdo->prepare("SELECT `tag_name` FROM `tags_mailbox` WHERE `username`= :username");