add "mox localserve" subcommand, for running mox locally for email-related testing/developing

localserve creates a config for listening on localhost for
imap/smtp/submission/http, on port numbers 1000 + the common service port
numbers. all incoming email is accepted (if checks pass), and a few pattern in
localparts are recognized and result in delivery errors.
This commit is contained in:
Mechiel Lukkien
2023-03-12 10:38:02 +01:00
parent bddc8e4062
commit 0099197d00
12 changed files with 694 additions and 108 deletions

View File

@ -55,17 +55,7 @@ func TestReputation(t *testing.T) {
}
}
var ipmasked1, ipmasked2, ipmasked3 string
var xip = net.ParseIP(ip)
if xip.To4() != nil {
ipmasked1 = xip.String()
ipmasked2 = xip.Mask(net.CIDRMask(26, 32)).String()
ipmasked3 = xip.Mask(net.CIDRMask(21, 32)).String()
} else {
ipmasked1 = xip.Mask(net.CIDRMask(64, 128)).String()
ipmasked2 = xip.Mask(net.CIDRMask(48, 128)).String()
ipmasked3 = xip.Mask(net.CIDRMask(32, 128)).String()
}
ipmasked1, ipmasked2, ipmasked3 := ipmasked(net.ParseIP(ip))
uidgen++
m := store.Message{