id = "swaks"
name = "Swaks"
homepage = "https://www.jetmore.org/john/code/swaks/"
description = "Swiss Army Knife for SMTP."
executables = ["swaks"]
[dotfiles]
paths = []
secret = ["~/.swaksrc"]
[commands]
format = 1
label = "Send a test email"
description = "Send a test SMTP transaction with Swaks. Proxy, XCLIENT, pipe/socket transports, DATA templates and TLS verification details are left out."
quality = "ai-draft"
parser = { end_of_options = "--", interleave = "permute", long_equals = false, short_attached = false, short_bundles = false }
[[commands.source]]
id = "manual"
kind = "manual"
url = "https://www.jetmore.org/john/code/swaks/latest/doc/ref.txt"
revision = "2026-10-27"
evidence = """
-s, --server [<target-server>[:<port>]]
-p, --port [<port>]
-t, --to [<email-address>[,<email-address>[,...]]]
-f, --from [<email-address>]
-q, --quit, --quit-after <stop-point>
--timeout [<time>]
--protocol <protocol>
-tls
-tlso, --tls-optional
-tlsos, --tls-optional-strict
-tlsc, --tls-on-connect
-tlsp, --tls-protocol <tls-version-specification>
-a, --auth [<auth-type>[,<auth-type>[,...]]]
-au, --auth-user [<username>]
-ap, --auth-password [<password>]
--body [<body-specification>]
--attach [<attachment-specification>]
-ah, --add-header <header>
--header <header-and-data>, --h-<header> <data>
-n, --suppress-data
"""
[[commands.field]]
id = "to"
label = "Recipient"
description = "Comma-separated recipient addresses."
type = "string"
option = ["--to", "-t"]
sources = ["manual"]
[[commands.field]]
id = "from"
label = "Envelope sender"
type = "string"
option = ["--from", "-f"]
sources = ["manual"]
[[commands.field]]
id = "server"
label = "Server"
description = "Host or IP, optionally host:port."
type = "string"
option = ["--server", "-s"]
sources = ["manual"]
[[commands.field]]
id = "port"
label = "Port"
type = "integer"
option = ["--port", "-p"]
sources = ["manual"]
[[commands.field]]
id = "protocol"
label = "Protocol"
type = "enum"
option = ["--protocol"]
choices = [{ value = "SMTP", label = "SMTP" }, { value = "ESMTP", label = "ESMTP" }, { value = "LMTP", label = "LMTP" }]
sources = ["manual"]
[[commands.field]]
id = "tls"
label = "Require STARTTLS"
type = "boolean"
option = ["-tls"]
sources = ["manual"]
[[commands.field]]
id = "tls_on_connect"
label = "TLS on connect"
type = "boolean"
option = ["--tls-on-connect", "-tlsc"]
sources = ["manual"]
[[commands.field]]
id = "auth"
label = "Authenticate"
description = "Try authentication with the user and password below."
type = "boolean"
option = ["--auth", "-a"]
sources = ["manual"]
[[commands.field]]
id = "auth_user"
label = "Auth user"
type = "string"
option = ["--auth-user", "-au"]
sources = ["manual"]
[[commands.field]]
id = "auth_password"
label = "Auth password"
description = "Visible in shell history; prefer leaving it unset so Swaks prompts."
type = "string"
option = ["--auth-password", "-ap"]
sources = ["manual"]
[[commands.field]]
id = "header"
label = "Header"
description = "Header and data, e.g. Subject: hello."
type = "string"
option = ["--header"]
sources = ["manual"]
[[commands.field]]
id = "body"
label = "Body"
type = "string"
option = ["--body"]
sources = ["manual"]
[[commands.field]]
id = "attach"
label = "Attachment"
type = "path"
option = ["--attach"]
path = { kind = "file", role = "input", must_exist = true }
sources = ["manual"]
[[commands.field]]
id = "quit_after"
label = "Stop after"
type = "string"
option = ["--quit-after", "-q"]
sources = ["manual"]
[[commands.field]]
id = "suppress_data"
label = "Summarise DATA"
type = "boolean"
option = ["--suppress-data", "-n"]
sources = ["manual"]
[[commands.task]]
id = "send"
label = "Send test message"
fields = ["to", "from", "server", "header", "body"]
required = ["to", "server"]
[[commands.task]]
id = "tls_auth"
label = "Send over TLS with auth"
fields = ["to", "from", "server", "tls", "auth", "auth_user", "header", "body"]
required = ["to", "server", "auth", "auth_user"]
set = { tls = [true], auth = [true] }
[[commands.group]]
id = "basic"
label = "Basic"
fields = ["to", "from", "server", "header", "body"]
[[commands.group]]
id = "advanced"
label = "Advanced"
fields = ["port", "protocol", "tls", "tls_on_connect", "auth", "auth_user", "auth_password", "attach", "quit_after", "suppress_data"]