mirror of
https://github.com/mjl-/mox.git
synced 2025-07-10 07:54:40 +03:00
expose fewer internals in packages, for easier software reuse
- prometheus is now behind an interface, they aren't dependencies for the reusable components anymore. - some dependencies have been inverted: instead of packages importing a main package to get configuration, the main package now sets configuration in these packages. that means fewer internals are pulled in. - some functions now have new parameters for values that were retrieved from package "mox-".
This commit is contained in:
@ -8,7 +8,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/mjl-/mox/dns"
|
||||
"github.com/mjl-/mox/moxvar"
|
||||
"github.com/mjl-/mox/mox-"
|
||||
"github.com/mjl-/mox/smtp"
|
||||
)
|
||||
|
||||
@ -308,7 +308,7 @@ func (p *parser) xipdomain(isehlo bool) dns.IPDomain {
|
||||
// Mail user agents that submit are relatively likely to use IPs in EHLO and forget
|
||||
// that an IPv6 address needs to be tagged as such. We can forgive them. For
|
||||
// SMTP servers we are strict.
|
||||
return isehlo && p.conn.submission && !moxvar.Pedantic && ip.To16() != nil
|
||||
return isehlo && p.conn.submission && !mox.Pedantic && ip.To16() != nil
|
||||
}
|
||||
if ipv6 && isv4 {
|
||||
p.xerrorf("ip address is not ipv6")
|
||||
@ -337,7 +337,7 @@ func (p *parser) xlocalpart() smtp.Localpart {
|
||||
}
|
||||
}
|
||||
// In the wild, some services use large localparts for generated (bounce) addresses.
|
||||
if moxvar.Pedantic && len(s) > 64 || len(s) > 128 {
|
||||
if mox.Pedantic && len(s) > 64 || len(s) > 128 {
|
||||
// ../rfc/5321:3486
|
||||
p.xerrorf("localpart longer than 64 octets")
|
||||
}
|
||||
|
Reference in New Issue
Block a user