mirror of
https://github.com/mjl-/mox.git
synced 2025-07-10 09:14:39 +03:00
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:
@ -39,8 +39,6 @@ func tcheck(t *testing.T, err error, msg string) {
|
||||
// We check if we receive the message.
|
||||
func TestDeliver(t *testing.T) {
|
||||
mlog.Logfmt = true
|
||||
mox.Context, mox.ContextCancel = context.WithCancel(context.Background())
|
||||
mox.Shutdown, mox.ShutdownCancel = context.WithCancel(context.Background())
|
||||
|
||||
// Remove state.
|
||||
os.RemoveAll("testdata/integration/data")
|
||||
@ -53,7 +51,7 @@ func TestDeliver(t *testing.T) {
|
||||
// Load mox config.
|
||||
mox.ConfigStaticPath = "testdata/integration/config/mox.conf"
|
||||
filepath.Join(filepath.Dir(mox.ConfigStaticPath), "domains.conf")
|
||||
if errs := mox.LoadConfig(mox.Context, false); len(errs) > 0 {
|
||||
if errs := mox.LoadConfig(context.Background(), false); len(errs) > 0 {
|
||||
t.Fatalf("loading mox config: %v", errs)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user