Prepend Return-Path header when receiving email
This commit is contained in:
parent
eb210e7bed
commit
fdb43533cd
1 changed files with 4 additions and 0 deletions
|
|
@ -92,6 +92,10 @@ func (s *Session) Data(r io.Reader) error {
|
||||||
|
|
||||||
log.Printf("LMTP: Received %d bytes", len(emailData))
|
log.Printf("LMTP: Received %d bytes", len(emailData))
|
||||||
|
|
||||||
|
// Prepend Return-Path header from envelope sender
|
||||||
|
returnPath := fmt.Sprintf("Return-Path: <%s>\r\n", s.from)
|
||||||
|
emailData = append([]byte(returnPath), emailData...)
|
||||||
|
|
||||||
// Process email for each recipient
|
// Process email for each recipient
|
||||||
// LMTP requires per-recipient status, but go-smtp handles this internally
|
// LMTP requires per-recipient status, but go-smtp handles this internally
|
||||||
for _, recipient := range s.recipients {
|
for _, recipient := range s.recipients {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue