Skip to content

Commit

Permalink
feat: add smtp auth login support
Browse files Browse the repository at this point in the history
  • Loading branch information
buroa committed Feb 23, 2024
1 parent 1d6cd8c commit 61794c5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/target/smtp/sasl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 61794c5

Please sign in to comment.