mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 12:24:38 +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:
@ -5,7 +5,6 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/mjl-/mox/moxvar"
|
||||
"github.com/mjl-/mox/smtp"
|
||||
)
|
||||
|
||||
@ -29,7 +28,7 @@ func MessageIDCanonical(s string) (string, bool, error) {
|
||||
// Seen in practice: Message-ID: <valid@valid.example> (added by postmaster@some.example)
|
||||
// Doesn't seem valid, but we allow it.
|
||||
s, rem, have := strings.Cut(s, ">")
|
||||
if !have || (rem != "" && (moxvar.Pedantic || !strings.HasPrefix(rem, " "))) {
|
||||
if !have || (rem != "" && (Pedantic || !strings.HasPrefix(rem, " "))) {
|
||||
return "", false, fmt.Errorf("%w: missing >", errBadMessageID)
|
||||
}
|
||||
// We canonicalize the Message-ID: lower-case, no unneeded quoting.
|
||||
|
Reference in New Issue
Block a user