Apply 1 suggestion(s) to 1 file(s)
This commit is contained in:
parent
4d01579505
commit
4c96e6a11f
1 changed files with 9 additions and 0 deletions
|
|
@ -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")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue