diff --git a/helm/templates/zh-cn.yaml b/helm/templates/zh-cn.yaml index 0440bca3..3dffabbe 100644 --- a/helm/templates/zh-cn.yaml +++ b/helm/templates/zh-cn.yaml @@ -34,6 +34,9 @@ data: rule_group: "规则组" rule_level: "规则级别" name: "名称" + receiver: "接收者" + workload_type: "工作负载类型" + rule_type: "规则类型" kind: ConfigMap metadata: name: zh-cn diff --git a/pkg/notify/notifier/email/email.go b/pkg/notify/notifier/email/email.go index 2d93160b..4b1ff94f 100644 --- a/pkg/notify/notifier/email/email.go +++ b/pkg/notify/notifier/email/email.go @@ -203,6 +203,9 @@ func (n *Notifier) send(ctx context.Context, to, subject, body string) error { if err != nil { return err } + if conn == nil { + return utils.Errorf("failed to connect to %s", addr) + } c, err := smtp.NewClient(conn, n.receiver.SmartHost.Host) if err != nil {