Skip to content

Commit 29bcd7f

Browse files
authored
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.
1 parent 6ebdfd7 commit 29bcd7f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sender/sender.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ func SendEmail(account *config.Account, to, cc, bcc []string, subject, plainBody
724724
}
725725

726726
// Send Envelope
727-
if err = c.Mail(account.GetFetchEmail()); err != nil {
727+
if err = c.Mail(account.GetSendAsEmail()); err != nil {
728728
return nil, err
729729
}
730730
for _, r := range allRecipients {
@@ -929,7 +929,7 @@ func SendCalendarReply(account *config.Account, to []string, subject, plainBody
929929
}
930930
}
931931

932-
if err = c.Mail(account.GetFetchEmail()); err != nil {
932+
if err = c.Mail(account.GetSendAsEmail()); err != nil {
933933
return nil, err
934934
}
935935
for _, r := range to {

0 commit comments

Comments
 (0)