From 29bcd7f34aa24186383a154dde58815a5aee2298 Mon Sep 17 00:00:00 2001 From: FromSi Date: Sat, 16 May 2026 17:54:37 +0500 Subject: [PATCH] fix(reply): use send-as envelope (#1279) ## What? Updates the SMTP envelope sender for outgoing mail. Matcha now uses `send_as_email` for `MAIL FROM` when it is configured. If it is not configured, it keeps the existing fallback behavior. This applies to regular email sending and calendar replies. ## Why? Closes #1274 Previously, `MAIL FROM` was based on `fetch_email`, with `account.email` as the fallback. Now the order is: ```text send_as_email -> fetch_email -> account.email ``` `fetch_email` is used to match incoming messages to an account. For outgoing mail, the configured Send-As address should be used first. --- sender/sender.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sender/sender.go b/sender/sender.go index 4eea308d6edd3beafcab863d0143b05c8621ff24..4df43a934bf16f968391b83fc8bf863157ce5617 100644 --- a/sender/sender.go +++ b/sender/sender.go @@ -724,7 +724,7 @@ func SendEmail(account *config.Account, to, cc, bcc []string, subject, plainBody } // Send Envelope - if err = c.Mail(account.GetFetchEmail()); err != nil { + if err = c.Mail(account.GetSendAsEmail()); err != nil { return nil, err } for _, r := range allRecipients { @@ -929,7 +929,7 @@ func SendCalendarReply(account *config.Account, to []string, subject, plainBody } } - if err = c.Mail(account.GetFetchEmail()); err != nil { + if err = c.Mail(account.GetSendAsEmail()); err != nil { return nil, err } for _, r := range to {