Skip to content

Commit

Permalink
Merge branch 'release/v1.6.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
axllent committed Apr 21, 2023
2 parents 0ff6b18 + b63e9b4 commit 924ad9b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 11 additions & 6 deletions server/apiv1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 924ad9b

Please sign in to comment.