补齐IMAP和POP3配置并统一邮件协议监听端口
This commit is contained in:
1 parent
9b60eb2177
commit
24829c1199
27 files changed
+868
-80
No files matched your search
@@ -0,0 +1,48 @@
|
||||
package config
|
||||
|
||||
// 邮件监听与发信中继相互独立。零值表示沿用兼容默认值,不表示关闭服务。
|
||||
type SMTPListenerConfig struct {
|
||||
Port int `json:"port"`
|
||||
STARTTLSPort int `json:"starttlsPort"`
|
||||
TLSPort int `json:"tlsPort"`
|
||||
}
|
||||
|
||||
type IMAPListenerConfig struct {
|
||||
TLSPort int `json:"tlsPort"`
|
||||
}
|
||||
|
||||
type POP3ListenerConfig struct {
|
||||
Port int `json:"port"`
|
||||
TLSPort int `json:"tlsPort"`
|
||||
}
|
||||
|
||||
// ResolveMailPorts 是公开配置视图、冲突校验及真实监听的共同端口来源。
|
||||
func ResolveMailPorts(smtp SMTPSectionConfig, email EmailSectionConfig) MailPorts {
|
||||
portOr := func(port, fallback int) int {
|
||||
if validPort(port) {
|
||||
return port
|
||||
}
|
||||
return fallback
|
||||
}
|
||||
return MailPorts{
|
||||
SMTP: portOr(smtp.Listener.Port, portOr(email.Policy.SMTPPort, 25)),
|
||||
SMTPSTARTTLS: portOr(smtp.Listener.STARTTLSPort, 587),
|
||||
SMTPTLS: portOr(smtp.Listener.TLSPort, 465),
|
||||
// 旧版 imapPort 从未用于监听;保留原有的 993,避免升级后擅自切换客户端端口。
|
||||
IMAP: portOr(email.IMAP.TLSPort, 993),
|
||||
POP3: portOr(email.POP3.Port, portOr(email.Policy.POP3Port, 110)),
|
||||
POP3TLS: portOr(email.POP3.TLSPort, 995),
|
||||
}
|
||||
}
|
||||
|
||||
func validateMailListeners(smtp SMTPSectionConfig, email EmailSectionConfig) error {
|
||||
for _, port := range []int{
|
||||
smtp.Listener.Port, smtp.Listener.STARTTLSPort, smtp.Listener.TLSPort,
|
||||
email.IMAP.TLSPort, email.POP3.Port, email.POP3.TLSPort,
|
||||
} {
|
||||
if port != 0 && !validPort(port) {
|
||||
return ErrPortConflict
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestMailListenerConfigurationOverridesLegacyPolicyAndIgnoresRelay(t *testing.T) {
|
||||
previous := CurrentManager()
|
||||
defer SetRuntimeManager(previous)
|
||||
runtime := validRuntimeConfig()
|
||||
runtime.SMTP.Listener = SMTPListenerConfig{Port: 2525, STARTTLSPort: 2587, TLSPort: 2465}
|
||||
runtime.SMTP.Relay.RelayPort = 1993
|
||||
runtime.Email.IMAP = IMAPListenerConfig{TLSPort: 1993}
|
||||
runtime.Email.POP3 = POP3ListenerConfig{Port: 1110, TLSPort: 1995}
|
||||
SetRuntimeManager(&ConfigManager{snapshots: runtimeAccessSnapshotStore{runtime: runtime}})
|
||||
want := MailPorts{SMTP: 2525, SMTPSTARTTLS: 2587, SMTPTLS: 2465, IMAP: 1993, POP3: 1110, POP3TLS: 1995}
|
||||
if got := CurrentMailPorts(); got != want {
|
||||
t.Fatalf("listeners = %+v, want %+v", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestMailListenerValidationCoversEveryActualListener(t *testing.T) {
|
||||
for name, mutate := range map[string]func(*RuntimeConfig){
|
||||
"smtp_http": func(r *RuntimeConfig) { r.SMTP.Listener.Port = 80 },
|
||||
"smtp_starttls_https": func(r *RuntimeConfig) { r.SMTP.Listener.STARTTLSPort = 443 },
|
||||
"smtp_tls_imap": func(r *RuntimeConfig) { r.SMTP.Listener.TLSPort = 993 },
|
||||
"imap_pop3_tls": func(r *RuntimeConfig) { r.Email.IMAP.TLSPort = 995 },
|
||||
"pop3_smtp": func(r *RuntimeConfig) { r.Email.POP3.Port = 25 },
|
||||
"pop3_tls_starttls": func(r *RuntimeConfig) { r.Email.POP3.TLSPort = 587 },
|
||||
"http_default": func(r *RuntimeConfig) { r.Root.HTTP.Port = 0; r.Email.IMAP.TLSPort = 80 },
|
||||
"smtp_negative": func(r *RuntimeConfig) { r.SMTP.Listener.Port = -1 },
|
||||
"starttls_overflow": func(r *RuntimeConfig) { r.SMTP.Listener.STARTTLSPort = 65536 },
|
||||
"tls_negative": func(r *RuntimeConfig) { r.SMTP.Listener.TLSPort = -1 },
|
||||
"imap_overflow": func(r *RuntimeConfig) { r.Email.IMAP.TLSPort = 65536 },
|
||||
"pop3_negative": func(r *RuntimeConfig) { r.Email.POP3.Port = -1 },
|
||||
"pop3_tls_overflow": func(r *RuntimeConfig) { r.Email.POP3.TLSPort = 65536 },
|
||||
} {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
runtime := validRuntimeConfig()
|
||||
mutate(&runtime)
|
||||
if err := ValidateRuntimeConfig(runtime, RuntimeValidationOptions{HasSuperAdmin: true}); !errors.Is(err, ErrPortConflict) {
|
||||
t.Fatalf("validation = %v, want port conflict", err)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestMailListenerCandidateApplyAndReloadPreservesAllSections(t *testing.T) {
|
||||
root := t.TempDir()
|
||||
initial := validRuntimeConfig()
|
||||
writeRuntimeFixture(t, root, initial)
|
||||
options := ConfigLoaderOptions{Validation: RuntimeValidationOptions{HasSuperAdmin: true, Production: true}}
|
||||
manager, err := NewConfigManager(root, options)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for _, section := range []Section{SectionSMTP, SectionEmail} {
|
||||
current := manager.Snapshot()
|
||||
var value any
|
||||
if section == SectionSMTP {
|
||||
current.SMTP.Listener = SMTPListenerConfig{Port: 2525, STARTTLSPort: 2587, TLSPort: 2465}
|
||||
value = current.SMTP
|
||||
} else {
|
||||
current.Email.IMAP.TLSPort = 1993
|
||||
current.Email.POP3 = POP3ListenerConfig{Port: 1110, TLSPort: 1995}
|
||||
value = current.Email
|
||||
}
|
||||
payload, err := json.Marshal(value)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
updated, err := manager.Update(context.Background(), UpdateRequest{
|
||||
Section: section, ExpectedGeneration: current.Generation, Payload: payload, Actor: authorizedConfigActor(),
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if manager.Snapshot().Generation != current.Generation {
|
||||
t.Fatal("saving candidate published it prematurely")
|
||||
}
|
||||
if _, err := manager.ApplyPendingAuthorized(context.Background(), updated.Generation, updated.CandidateID, section, authorizedConfigActor()); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
reloaded, err := NewConfigLoader(root, options).Load()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
want := MailPorts{SMTP: 2525, SMTPSTARTTLS: 2587, SMTPTLS: 2465, IMAP: 1993, POP3: 1110, POP3TLS: 1995}
|
||||
if got := ResolveMailPorts(reloaded.SMTP, reloaded.Email); got != want {
|
||||
t.Fatalf("reloaded listeners = %+v, want %+v", got, want)
|
||||
}
|
||||
if reloaded.Email.Policy != initial.Email.Policy || reloaded.SMTP.Relay != initial.SMTP.Relay {
|
||||
t.Fatal("listener change overwrote policy or relay")
|
||||
}
|
||||
}
|
||||
|
||||
func TestMailListenerConflictsUseEffectiveWebPorts(t *testing.T) {
|
||||
previous := RuntimeSetupPort()
|
||||
t.Cleanup(func() { SetRuntimeSetupPort(previous) })
|
||||
for _, tc := range []struct {
|
||||
name string
|
||||
http HTTPConfig
|
||||
envHTTP string
|
||||
envHTTPS string
|
||||
setupPort int
|
||||
mailPort int
|
||||
conflict bool
|
||||
}{
|
||||
{"environment_http", HTTPConfig{}, "9080", "", 8080, 9080, true},
|
||||
{"setup_http", HTTPConfig{}, "", "", 8080, 8080, true},
|
||||
{"configured_http", HTTPConfig{Port: 7080}, "9080", "", 8080, 7080, true},
|
||||
{"unused_environment_http", HTTPConfig{Port: 7080}, "9080", "", 8080, 9080, false},
|
||||
{"environment_https", HTTPConfig{HTTPSEnabled: true}, "", "9443", 8080, 9443, true},
|
||||
{"default_https", HTTPConfig{HTTPSEnabled: true}, "", "", 8080, 443, true},
|
||||
{"proxy_no_internal_https", HTTPConfig{TLSMode: HTTPSTLSModeProxy}, "", "9443", 8080, 9443, false},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
t.Setenv("SMAIL_HTTP_PORT", tc.envHTTP)
|
||||
t.Setenv("SMAIL_HTTPS_PORT", tc.envHTTPS)
|
||||
SetRuntimeSetupPort(tc.setupPort)
|
||||
ports := ResolveMailPorts(SMTPSectionConfig{}, EmailSectionConfig{})
|
||||
ports.IMAP = tc.mailPort
|
||||
err := validateRuntimePorts(tc.http, ports)
|
||||
if errors.Is(err, ErrPortConflict) != tc.conflict {
|
||||
t.Fatalf("validation = %v, want conflict %v", err, tc.conflict)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestOldPartitionPayloadsKeepExistingListenerDefaults(t *testing.T) {
|
||||
var smtp SMTPSectionConfig
|
||||
var email EmailSectionConfig
|
||||
if err := ParseStrict([]byte(`{"meta":{"schema":1,"generation":1},"relay":{"relayPort":2465}}`), &smtp); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := ParseStrict([]byte(`{"meta":{"schema":1,"generation":1},"policy":{"smtpPort":2525,"imapPort":1143,"pop3Port":1110}}`), &email); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
want := MailPorts{SMTP: 2525, SMTPSTARTTLS: 587, SMTPTLS: 465, IMAP: 993, POP3: 1110, POP3TLS: 995}
|
||||
if got := ResolveMailPorts(smtp, email); got != want {
|
||||
t.Fatalf("legacy listeners changed: %+v", got)
|
||||
}
|
||||
}
|
||||
@@ -162,9 +162,12 @@ func cloneConfig(source *Config) *Config {
|
||||
}
|
||||
|
||||
type MailPorts struct {
|
||||
SMTP int
|
||||
IMAP int
|
||||
POP3 int
|
||||
SMTP int
|
||||
SMTPSTARTTLS int
|
||||
SMTPTLS int
|
||||
IMAP int
|
||||
POP3 int
|
||||
POP3TLS int
|
||||
}
|
||||
|
||||
type MailDomains struct {
|
||||
@@ -273,18 +276,13 @@ func CurrentSMTPRuntimeSettings() (SMTPRuntimeSettings, error) {
|
||||
}
|
||||
|
||||
func CurrentMailPorts() MailPorts {
|
||||
ports := MailPorts{SMTP: 25, IMAP: 143, POP3: 110}
|
||||
policy := CurrentEmailPolicy()
|
||||
if policy.SMTPPort > 0 && policy.SMTPPort <= 65535 {
|
||||
ports.SMTP = policy.SMTPPort
|
||||
if manager := CurrentManager(); manager != nil {
|
||||
if runtime := manager.Snapshot(); runtime.Generation != 0 {
|
||||
return ResolveMailPorts(runtime.SMTP, runtime.Email)
|
||||
}
|
||||
}
|
||||
if policy.IMAPPort > 0 && policy.IMAPPort <= 65535 {
|
||||
ports.IMAP = policy.IMAPPort
|
||||
}
|
||||
if policy.POP3Port > 0 && policy.POP3Port <= 65535 {
|
||||
ports.POP3 = policy.POP3Port
|
||||
}
|
||||
return ports
|
||||
// 旧版 SMTPPort 属于发信中继,不能用作本机监听端口。
|
||||
return ResolveMailPorts(SMTPSectionConfig{}, EmailSectionConfig{})
|
||||
}
|
||||
func cloneHTTPConfig(source HTTPConfig) HTTPConfig {
|
||||
clone := source
|
||||
|
||||
@@ -70,7 +70,7 @@ func TestCurrentMailPortsUsesSafeDefaultsWithoutRuntimeManager(t *testing.T) {
|
||||
defer SetRuntimeManager(previousManager)
|
||||
SetRuntimeManager(nil)
|
||||
|
||||
if got := CurrentMailPorts(); got != (MailPorts{SMTP: 25, IMAP: 143, POP3: 110}) {
|
||||
if got := CurrentMailPorts(); got != (MailPorts{SMTP: 25, SMTPSTARTTLS: 587, SMTPTLS: 465, IMAP: 993, POP3: 110, POP3TLS: 995}) {
|
||||
t.Fatalf("mail ports = %+v, want safe defaults", got)
|
||||
}
|
||||
}
|
||||
@@ -131,7 +131,7 @@ func TestCurrentMailPortsReadsEmailPolicySnapshot(t *testing.T) {
|
||||
runtime.Email.Policy.POP3Port = 1110
|
||||
SetRuntimeManager(&ConfigManager{snapshots: runtimeAccessSnapshotStore{runtime: runtime}})
|
||||
|
||||
if got := CurrentMailPorts(); got != (MailPorts{SMTP: 2525, IMAP: 1143, POP3: 1110}) {
|
||||
if got := CurrentMailPorts(); got != (MailPorts{SMTP: 2525, SMTPSTARTTLS: 587, SMTPTLS: 465, IMAP: 993, POP3: 1110, POP3TLS: 995}) {
|
||||
t.Fatalf("mail ports = %+v, want policy ports", got)
|
||||
}
|
||||
}
|
||||
@@ -146,7 +146,7 @@ func TestCurrentMailPortsFallsBackForInvalidPolicyValues(t *testing.T) {
|
||||
runtime.Email.Policy.POP3Port = -1
|
||||
SetRuntimeManager(&ConfigManager{snapshots: runtimeAccessSnapshotStore{runtime: runtime}})
|
||||
|
||||
if got := CurrentMailPorts(); got != (MailPorts{SMTP: 25, IMAP: 143, POP3: 110}) {
|
||||
if got := CurrentMailPorts(); got != (MailPorts{SMTP: 25, SMTPSTARTTLS: 587, SMTPTLS: 465, IMAP: 993, POP3: 110, POP3TLS: 995}) {
|
||||
t.Fatalf("mail ports = %+v, want defaults for invalid policy values", got)
|
||||
}
|
||||
}
|
||||
@@ -160,7 +160,7 @@ func TestCurrentMailPortsDoesNotReadLegacyRelayPort(t *testing.T) {
|
||||
runtime.Email.Policy = EmailConfig{}
|
||||
SetRuntimeManager(&ConfigManager{snapshots: runtimeAccessSnapshotStore{runtime: runtime}})
|
||||
|
||||
if got := CurrentMailPorts(); got != (MailPorts{SMTP: 25, IMAP: 143, POP3: 110}) {
|
||||
if got := CurrentMailPorts(); got != (MailPorts{SMTP: 25, SMTPSTARTTLS: 587, SMTPTLS: 465, IMAP: 993, POP3: 110, POP3TLS: 995}) {
|
||||
t.Fatalf("mail ports = %+v, legacy relay port leaked into listener ports", got)
|
||||
}
|
||||
}
|
||||
@@ -170,7 +170,7 @@ func TestCurrentMailPortsUsesDefaultsForUnavailableSnapshot(t *testing.T) {
|
||||
defer SetRuntimeManager(previousManager)
|
||||
SetRuntimeManager(&ConfigManager{})
|
||||
|
||||
if got := CurrentMailPorts(); got != (MailPorts{SMTP: 25, IMAP: 143, POP3: 110}) {
|
||||
if got := CurrentMailPorts(); got != (MailPorts{SMTP: 25, SMTPSTARTTLS: 587, SMTPTLS: 465, IMAP: 993, POP3: 110, POP3TLS: 995}) {
|
||||
t.Fatalf("mail ports = %+v, want defaults for unavailable snapshot", got)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,10 @@ func ValidateRuntimeConfig(runtime RuntimeConfig, options RuntimeValidationOptio
|
||||
if err := validateDomains(runtime.Root.Domains); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := validateRuntimePorts(runtime.Root.HTTP, runtime.Email.Policy); err != nil {
|
||||
if err := validateMailListeners(runtime.SMTP, runtime.Email); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := validateRuntimePorts(runtime.Root.HTTP, ResolveMailPorts(runtime.SMTP, runtime.Email)); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := validatePluginSection(runtime.Plugins); err != nil {
|
||||
@@ -65,9 +68,6 @@ func ValidateRuntimeConfig(runtime RuntimeConfig, options RuntimeValidationOptio
|
||||
if !options.HasSuperAdmin || runtime.Root.Domains.Primary == "" || len(runtime.Root.Domains.Accepted) == 0 || runtime.Root.Domains.Web == "" || !runtime.Root.Database.IsStructured() {
|
||||
return ErrInvalidRuntimeConfig
|
||||
}
|
||||
if runtime.Email.Policy.SMTPPort == 0 || runtime.Email.Policy.IMAPPort == 0 || runtime.Email.Policy.POP3Port == 0 {
|
||||
return ErrInvalidRuntimeConfig
|
||||
}
|
||||
if runtime.Root.HTTP.HTTPSEnabled && runtime.Root.HTTP.HTTPSPort == 0 {
|
||||
return ErrInvalidRuntimeConfig
|
||||
}
|
||||
@@ -126,8 +126,10 @@ func normalizeConfigAccessHost(value string) (string, error) {
|
||||
return normalizeConfigDomain(value)
|
||||
}
|
||||
|
||||
func validateRuntimePorts(http HTTPConfig, email EmailConfig) error {
|
||||
ports := []int{http.Port, email.SMTPPort, email.IMAPPort, email.POP3Port}
|
||||
func validateRuntimePorts(http HTTPConfig, mail MailPorts) error {
|
||||
// 与实际 Web 监听使用相同的环境变量、启动端口及反代默认值。
|
||||
http = ResolveHTTPPortDefaults(http, RuntimeSetupPort())
|
||||
ports := []int{http.Port, mail.SMTP, mail.SMTPSTARTTLS, mail.SMTPTLS, mail.IMAP, mail.POP3, mail.POP3TLS}
|
||||
if http.HTTPSEnabled || http.HTTPSPort != 0 {
|
||||
ports = append(ports, http.HTTPSPort)
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ func TestValidateRuntimeConfigRejectsCrossSectionViolations(t *testing.T) {
|
||||
mutate func(*RuntimeConfig, *RuntimeValidationOptions)
|
||||
want error
|
||||
}{
|
||||
{name: "port_conflict", mutate: func(runtime *RuntimeConfig, _ *RuntimeValidationOptions) { runtime.Email.Policy.IMAPPort = 443 }, want: ErrPortConflict},
|
||||
{name: "port_conflict", mutate: func(runtime *RuntimeConfig, _ *RuntimeValidationOptions) { runtime.Email.IMAP.TLSPort = 443 }, want: ErrPortConflict},
|
||||
{name: "primary_domain_missing", mutate: func(runtime *RuntimeConfig, _ *RuntimeValidationOptions) {
|
||||
runtime.Root.Domains.Accepted = []string{"example.com"}
|
||||
}, want: ErrInvalidDomainConfig},
|
||||
|
||||
@@ -54,13 +54,16 @@ const (
|
||||
)
|
||||
|
||||
type SMTPSectionConfig struct {
|
||||
Meta SectionMeta `json:"meta"`
|
||||
Relay SMTPConfig `json:"relay"`
|
||||
Meta SectionMeta `json:"meta"`
|
||||
Relay SMTPConfig `json:"relay"`
|
||||
Listener SMTPListenerConfig `json:"listener,omitempty"`
|
||||
}
|
||||
|
||||
type EmailSectionConfig struct {
|
||||
Meta SectionMeta `json:"meta"`
|
||||
Policy EmailConfig `json:"policy"`
|
||||
Meta SectionMeta `json:"meta"`
|
||||
Policy EmailConfig `json:"policy"`
|
||||
IMAP IMAPListenerConfig `json:"imap,omitempty"`
|
||||
POP3 POP3ListenerConfig `json:"pop3,omitempty"`
|
||||
}
|
||||
|
||||
type SSLSectionConfig struct {
|
||||
|
||||
@@ -15,7 +15,7 @@ func TestSnapshotStoreRejectsInvalidCandidate(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
invalid := validRuntimeConfig()
|
||||
invalid.Email.Policy.IMAPPort = invalid.Root.HTTP.HTTPSPort
|
||||
invalid.Email.IMAP.TLSPort = invalid.Root.HTTP.HTTPSPort
|
||||
if err := store.Publish(invalid); err == nil {
|
||||
t.Fatal("invalid runtime configuration was published")
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ func TestSnapshotStoreRejectsInvalidCandidateWithoutChangingSnapshot(t *testing.
|
||||
}
|
||||
|
||||
invalid := cloneRuntimeConfig(initial)
|
||||
invalid.Email.Policy.IMAPPort = invalid.Root.HTTP.HTTPSPort
|
||||
invalid.Email.IMAP.TLSPort = invalid.Root.HTTP.HTTPSPort
|
||||
if err := store.Publish(invalid); !errors.Is(err, ErrPortConflict) {
|
||||
t.Fatalf("publish error = %v, want %v", err, ErrPortConflict)
|
||||
}
|
||||
@@ -191,8 +191,8 @@ func TestSnapshotStoreRejectsInvalidCandidateWithoutChangingSnapshot(t *testing.
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if after.Email.Policy.IMAPPort != before.Email.Policy.IMAPPort {
|
||||
t.Fatalf("snapshot changed after rejection: before=%d after=%d", before.Email.Policy.IMAPPort, after.Email.Policy.IMAPPort)
|
||||
if after.Email.IMAP.TLSPort != before.Email.IMAP.TLSPort {
|
||||
t.Fatalf("snapshot changed after rejection: before=%d after=%d", before.Email.IMAP.TLSPort, after.Email.IMAP.TLSPort)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ func TestConfigManagerRejectsInvalidUpdateWithoutDiskOrStatusMutation(t *testing
|
||||
beforeStatus := manager.Status()
|
||||
current := manager.Snapshot()
|
||||
invalidEmail := current.Email
|
||||
invalidEmail.Policy.IMAPPort = current.Root.HTTP.HTTPSPort
|
||||
invalidEmail.IMAP.TLSPort = current.Root.HTTP.HTTPSPort
|
||||
payload, err := json.Marshal(invalidEmail)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
||||
Reference in new issue
Block a user