{
  "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
    },
    "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>]]\n        -p, --port [<port>]\n    -t, --to [<email-address>[,<email-address>[,...]]]\n    -f, --from [<email-address>]\n    -q, --quit, --quit-after <stop-point>\n    --timeout [<time>]\n    --protocol <protocol>\n    -tls\n    -tlso, --tls-optional\n    -tlsos, --tls-optional-strict\n    -tlsc, --tls-on-connect\n    -tlsp, --tls-protocol <tls-version-specification>\n    -a, --auth [<auth-type>[,<auth-type>[,...]]]\n    -au, --auth-user [<username>]\n    -ap, --auth-password [<password>]\n    --body [<body-specification>]\n    --attach [<attachment-specification>]\n    -ah, --add-header <header>\n    --header <header-and-data>, --h-<header> <data>\n    -n, --suppress-data\n"
      }
    ],
    "field": [
      {
        "id": "to",
        "label": "Recipient",
        "description": "Comma-separated recipient addresses.",
        "type": "string",
        "option": [
          "--to",
          "-t"
        ],
        "sources": [
          "manual"
        ]
      },
      {
        "id": "from",
        "label": "Envelope sender",
        "type": "string",
        "option": [
          "--from",
          "-f"
        ],
        "sources": [
          "manual"
        ]
      },
      {
        "id": "server",
        "label": "Server",
        "description": "Host or IP, optionally host:port.",
        "type": "string",
        "option": [
          "--server",
          "-s"
        ],
        "sources": [
          "manual"
        ]
      },
      {
        "id": "port",
        "label": "Port",
        "type": "integer",
        "option": [
          "--port",
          "-p"
        ],
        "sources": [
          "manual"
        ]
      },
      {
        "id": "protocol",
        "label": "Protocol",
        "type": "enum",
        "option": [
          "--protocol"
        ],
        "choices": [
          {
            "value": "SMTP",
            "label": "SMTP"
          },
          {
            "value": "ESMTP",
            "label": "ESMTP"
          },
          {
            "value": "LMTP",
            "label": "LMTP"
          }
        ],
        "sources": [
          "manual"
        ]
      },
      {
        "id": "tls",
        "label": "Require STARTTLS",
        "type": "boolean",
        "option": [
          "-tls"
        ],
        "sources": [
          "manual"
        ]
      },
      {
        "id": "tls_on_connect",
        "label": "TLS on connect",
        "type": "boolean",
        "option": [
          "--tls-on-connect",
          "-tlsc"
        ],
        "sources": [
          "manual"
        ]
      },
      {
        "id": "auth",
        "label": "Authenticate",
        "description": "Try authentication with the user and password below.",
        "type": "boolean",
        "option": [
          "--auth",
          "-a"
        ],
        "sources": [
          "manual"
        ]
      },
      {
        "id": "auth_user",
        "label": "Auth user",
        "type": "string",
        "option": [
          "--auth-user",
          "-au"
        ],
        "sources": [
          "manual"
        ]
      },
      {
        "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"
        ]
      },
      {
        "id": "header",
        "label": "Header",
        "description": "Header and data, e.g. Subject: hello.",
        "type": "string",
        "option": [
          "--header"
        ],
        "sources": [
          "manual"
        ]
      },
      {
        "id": "body",
        "label": "Body",
        "type": "string",
        "option": [
          "--body"
        ],
        "sources": [
          "manual"
        ]
      },
      {
        "id": "attach",
        "label": "Attachment",
        "type": "path",
        "option": [
          "--attach"
        ],
        "path": {
          "kind": "file",
          "role": "input",
          "must_exist": true
        },
        "sources": [
          "manual"
        ]
      },
      {
        "id": "quit_after",
        "label": "Stop after",
        "type": "string",
        "option": [
          "--quit-after",
          "-q"
        ],
        "sources": [
          "manual"
        ]
      },
      {
        "id": "suppress_data",
        "label": "Summarise DATA",
        "type": "boolean",
        "option": [
          "--suppress-data",
          "-n"
        ],
        "sources": [
          "manual"
        ]
      }
    ],
    "task": [
      {
        "id": "send",
        "label": "Send test message",
        "fields": [
          "to",
          "from",
          "server",
          "header",
          "body"
        ],
        "required": [
          "to",
          "server"
        ]
      },
      {
        "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
          ]
        }
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "to",
          "from",
          "server",
          "header",
          "body"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "port",
          "protocol",
          "tls",
          "tls_on_connect",
          "auth",
          "auth_user",
          "auth_password",
          "attach",
          "quit_after",
          "suppress_data"
        ]
      }
    ]
  }
}
