mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-18 14:47:03 +00:00
queue: Always use the main domain for sending DSNs
Today, we pick the domain used to send the DSN from based on what we presented to the client at EHLO time, which itself may be based on the TLS negotiation (which is not necessarily trusted). This is complex, not necessarily correct, and involves passing the domain around through the queue and persisting it in the items. So this patch simplifies that handling by always using the main domain as specified by the configuration.
This commit is contained in:
@@ -15,11 +15,11 @@ const maxOrigMsgLen = 256 * 1024
|
||||
// There is a standard, https://tools.ietf.org/html/rfc3464, although most
|
||||
// MTAs seem to use a plain email and include an X-Failed-Recipients header.
|
||||
// We're going with the latter for now, may extend it to the former later.
|
||||
func deliveryStatusNotification(item *Item) ([]byte, error) {
|
||||
func deliveryStatusNotification(domainFrom string, item *Item) ([]byte, error) {
|
||||
info := dsnInfo{
|
||||
OurDomain: item.Hostname,
|
||||
OurDomain: domainFrom,
|
||||
Destination: item.From,
|
||||
MessageID: "chasquid-dsn-" + <-newID + "@" + item.Hostname,
|
||||
MessageID: "chasquid-dsn-" + <-newID + "@" + domainFrom,
|
||||
Date: time.Now().Format(time.RFC1123Z),
|
||||
To: item.To,
|
||||
Recipients: item.Rcpt,
|
||||
|
||||
Reference in New Issue
Block a user