From 61794c51639609f8403d11f5bca6a0a0b955fc75 Mon Sep 17 00:00:00 2001 From: Steven Kreitzer Date: Fri, 23 Feb 2024 12:05:21 -0600 Subject: [PATCH] feat: add smtp auth login support --- internal/target/smtp/sasl.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/target/smtp/sasl.go b/internal/target/smtp/sasl.go index 75f5d4e5..6af22e44 100644 --- a/internal/target/smtp/sasl.go +++ b/internal/target/smtp/sasl.go @@ -64,6 +64,13 @@ func saslAuthDirective(_ *config.Map, node config.Node) (interface{}, error) { return func(*module.MsgMetadata) (sasl.Client, error) { return sasl.NewPlainClient("", node.Args[1], node.Args[2]), nil }, nil + case "login": + if len(node.Args) != 3 { + return nil, config.NodeErr(node, "two additional arguments are required (username, password)") + } + return func(*module.MsgMetadata) (sasl.Client, error) { + return sasl.NewLoginClient(node.Args[1], node.Args[2]), nil + }, nil case "external": if len(node.Args) > 1 { return nil, config.NodeErr(node, "no additional arguments required")