for submission over IPv6, allow missing "IPv6" tag in ip address (unless in pedantic mode)

an EHLO ipv4 address looks like this: "[1.2.3.4]". for ipv6, the syntax is:
"[IPv6🔡:1]". mail user agents aren't as careful in compliance as smtp
servers. for incoming messages from smtp servers, we want to be strict (we're
eager to find a reason not to accept spam messages, and not adhering to the
standards is usually a strong spam signal), but there is no reason to punish
authenticated users.

for the syntax requirements, see ABNF rule "address-literal" in rfc 5321.

for issue #48 by @bobobo1618, thanks!
This commit is contained in:
Mechiel Lukkien
2023-07-22 14:20:50 +02:00
parent 9c25c88542
commit 70806137da
2 changed files with 16 additions and 6 deletions

View File

@ -772,7 +772,7 @@ func (c *conn) cmdHello(p *parser, ehlo bool) {
p.xspace()
var remote dns.IPDomain
if ehlo {
remote = p.xipdomain()
remote = p.xipdomain(true)
} else {
remote = dns.IPDomain{Domain: p.xdomain()}
if !c.submission {