Apply 1 suggestion(s) to 1 file(s)

This commit is contained in:
Slavi Pantaleev
2022-09-06 19:44:05 +00:00
committed by Aine
parent 4d01579505
commit 4c96e6a11f

View File

@@ -112,5 +112,14 @@ func (m *mta) connect(from, to string) (*smtp.Client, error) {
}
}
// If there are no MX records, according to https://datatracker.ietf.org/doc/html/rfc5321#section-5.1,
// we're supposed to try talking directly to the host.
if len(mxs) == 0 {
client := m.tryServer(localname, hostname)
if client != nil {
return client, nil
}
}
return nil, fmt.Errorf("target SMTP server not found")
}