From 124f1c2bdefac46100b173c92b59ebae874eaa52 Mon Sep 17 00:00:00 2001 From: Ralph Slooten Date: Fri, 21 Apr 2023 22:30:02 +1200 Subject: [PATCH 1/2] Bugfix: If set use return-path address as SMTP from address --- server/apiv1/api.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/server/apiv1/api.go b/server/apiv1/api.go index 0b718e279..c0676671e 100644 --- a/server/apiv1/api.go +++ b/server/apiv1/api.go @@ -586,13 +586,18 @@ func ReleaseMessage(w http.ResponseWriter, r *http.Request) { return } - if config.SMTPRelayConfig.ReturnPath != "" && m.Header.Get("Return-Path") != "<"+config.SMTPRelayConfig.ReturnPath+">" { - msg, err = tools.RemoveMessageHeaders(msg, []string{"Return-Path"}) - if err != nil { - httpError(w, err.Error()) - return + // set the Return-Path and SMTP mfrom + if config.SMTPRelayConfig.ReturnPath != "" { + if m.Header.Get("Return-Path") != "<"+config.SMTPRelayConfig.ReturnPath+">" { + msg, err = tools.RemoveMessageHeaders(msg, []string{"Return-Path"}) + if err != nil { + httpError(w, err.Error()) + return + } + msg = append([]byte("Return-Path: <"+config.SMTPRelayConfig.ReturnPath+">\r\n"), msg...) } - msg = append([]byte("Return-Path: <"+config.SMTPRelayConfig.ReturnPath+">\r\n"), msg...) + + from = config.SMTPRelayConfig.ReturnPath } // generate unique ID From b63e9b465b7245b4661258fb448658e726cca7d6 Mon Sep 17 00:00:00 2001 From: Ralph Slooten Date: Fri, 21 Apr 2023 22:31:01 +1200 Subject: [PATCH 2/2] Release v1.6.2 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49346ec8a..877aebf16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ Notable changes to Mailpit will be documented in this file. +## [v1.6.2] + +### Bugfix +- If set use return-path address as SMTP from address + + ## [v1.6.1] ### Bugfix