mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 17:47:03 +00:00
smtp: Don't require MIME headers for metadata
This was a regression, will again fall back to MAIL FROM/RCPT TO data.
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"net/mail"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -408,13 +409,14 @@ func (ss *Session) deliverMessage(recip *policy.Recipient, content []byte) (ok b
|
||||
}
|
||||
from, err := env.AddressList("From")
|
||||
if err != nil {
|
||||
ss.logError("Failed to get From address: %v", err)
|
||||
return false
|
||||
from = []*mail.Address{{Address: ss.from}}
|
||||
}
|
||||
to, err := env.AddressList("To")
|
||||
if err != nil {
|
||||
ss.logError("Failed to get To addresses: %v", err)
|
||||
return false
|
||||
to = make([]*mail.Address, len(ss.recipients))
|
||||
for i, torecip := range ss.recipients {
|
||||
to[i] = &torecip.Address
|
||||
}
|
||||
}
|
||||
// Generate Received header.
|
||||
stamp := time.Now().Format(timeStampFormat)
|
||||
|
||||
Reference in New Issue
Block a user