swaks Chinese documentation

1. Name (Swaks)

Swaks - 瑞士军刀 SMTP,通用 SMTP 事务测试器

2. Description

Swaks 的主要设计目标是成为一个灵活的、可编写脚本的、
面向交易的SMTP测试工具。它处理 SMTP 功能和
TLS、身份验证和流水线等扩展;多个版本
SMTP协议包括SMTP、ESMTP和LMTP;和多个
传输方法,包括 UNIX 域套接字、互联网域
套接字和管道到生成的进程。选项可以在
环境变量、配置文件和命令行
为操作员提供最大的可配置性和易用性,以及
编剧。

3. Quick start

将标准测试电子邮件发送到端口 25 上的 [email protected]
测试服务器.example.net:

     swaks --to [email protected] --server test-server.example.net

发送标准测试电子邮件,要求用户进行 CRAM-MD5 身份验证
我@example.com。“X-Test”标头将添加到电子邮件正文中。这
获取不到会提示验证密码
从你的 .netrc 文件。

     swaks --to [email protected] --from [email protected] --auth CRAM-MD5 --auth-user [email protected] --header-X-Test “测试邮件”

在附件中使用 EICAR 测试病毒扫描程序。不显示
消息数据部分:

     swaks -t [email protected] --attach - --server test-server.example.com --suppress-data </路径/to/eicar.txt

在电子邮件正文中使用 GTUBE 测试垃圾邮件扫描程序,通过
example.com 的 MX 记录:

     swaks --to [email protected] --body /path/to/gtube/file

使用 LMTP 向 [email protected] 发送标准测试电子邮件
通过 UNIX 域套接字文件的协议

     swaks --to [email protected] --socket /var/lda.sock --protocol LMTP

报告文本文件中不可验证的所有收件人
测试服务器:

     对于 `cat /path/to/email/file` 中的 E
     做
         swaks --to $E --server test-server.example.com --quit-after RCPT --hide-all
         [ $? -ne 0 ] && echo $E
     完毕

Terms and Conventions
This document attempts to use
the following terminology to reduce confusion.

目标
    事务的目标是 Swaks 连接的对象。
    这个通用术语在整个文档中使用,因为大多数
    其他术语不恰当地暗示了有关运输的某些事情
    用过的。

运输
    传输是用于连接到
    目标。

交易
    事务是通过传输打开连接到
    目标并使用消息传递协议来尝试传递
    信息。

协议
    该协议是用于与
    目标。本文档使用 SMTP 泛指所有
    三个受支持的协议,除非它声明它正在谈论
    特定的“SMTP”协议并排除其他协议。

信息
    存在 SMTP 协议来传输消息,消息中的一组字节
    具有发件人和收件人的商定格式。

信封
    消息的信封包含“真实”的发送者和接收者
    信息。它也可以被称为它的组件,
    信封发送者和信封接收者。重要的是要注意
    消息信封不必与其“收件人:”匹配,并且
    “发件人:”标题。

数据
    SMTP 事务的数据部分是实际消息
    正在运输中。它由邮件的标题和
    它的身体。DATA 和 body 有时作为同义词使用,但它们
    在本文档中始终是两个不同的事物。

标头
    消息的标头定义为消息的所有行
    第一个空行之前的 DATA 部分。它们包含信息
    关于将显示给收件人的电子邮件,例如
    “收件人:”、“发件人:”、“主题:”等。在本文档中,标题将
    总是用大写的首字母和尾随书写
    冒号。

身体
    消息的主体是其 DATA 部分之后的部分
    第一个空行。

选项
    选项是改变 Swaks 行为的标志。总是叫一个
    选项,不管它是如何提供的。例如,
    “--no-data-fixup”是一个选项。

争论
    当一个选项在选项本身旁边获取附加数据时,那
    附加数据称为参数。在“--退出后
    <stop-point>'", "<stop-point>" 是 "--quit-after" 的参数
    选项。

<文字字符串>
    在选项的定义中使用时,位于选项内部的文本
    尖括号 ("<>") 表示一个值的描述性标签,该值
    用户应提供。例如,“--quit-after <stop-point>”
    指示“<stop-point>”应该替换为有效的
    止点值。

[<可选值>]
    在选项定义中使用时,正方形内的文本
    括号([])表示该值是可选的,可以是
    省略。例如,“--to [<recipient>]”表示
    “--to”选项可以与或不与指定的“<recipient>”一起使用。

Option Handling
To prevent potential confusion in this documentation, Swaks' flags are
always referred to as "options". If the option requires additional data,
the additional data is called the option's argument. For
example, "--from [email protected]" might be supplied to the Swaks
command line, "--from" is the option, and "[email protected]"
is the argument to "--from".

选项和参数是向 Swaks 提供信息的唯一方式。
如果 Swaks 在选项处理过程中发现数据既不是选项
也不是选项的参数,它会出错并退出。例如,如果
在命令行上找到“--no-data-fixup 1”,这将导致
一个错误,因为“--no-data-fixup”不接受参数并且
因此 Swaks 不知道如何处理 1。

可以通过三种方式向 Swaks 提供期权。它们可以在一个
配置文件、环境变量和命令行。
根据具体选项以及是否为其提供参数,
Swaks 可能会提示用户输入参数。

当 Swaks 评估它的选项时,它首先寻找一个配置
文件(在默认位置或使用“--config”指定)。然后
它评估环境变量中的任何选项。最后,它评估
命令行选项。在每一轮处理中,任何选项集
较早的将被覆盖。此外,任何选项都可以作为前缀
用“no-”使 Swaks 忘记该变量之前
已设置(在较早的一轮中,或在同一轮中较早的时候)。
这种能力是必要的,因为许多选项对待
已定义但无参数不同于未定义。

作为一般规则,如果多次给出相同的选项,则最后一个
给出的时间就是将要使用的时间。这适用于两者
内部方法(如果“--from [email protected] --from [email protected]”是
给定,将使用“[email protected]”)和方法间(如果“来自
[email protected]”在配置文件中给出,“--from
[email protected]”在命令行上给出,“[email protected]”
将会被使用)

每个选项定义都以括号内的概要结尾,说明如何
选项行为。可以使用以下代码

Arg-无、Arg-可选、Arg-必需
    这三个代码是互斥的,分别描述是否
    该选项需要一个参数。请注意,这不一定
    描述是否需要直接指定参数,
    而是最终是否需要争论。例如,
    “--to”被标记为Arg-Required,但指定“--to”是合法的
    在没有参数的命令行上。这是因为 Swaks 可以
    如果未直接提供,则提示输入所需的参数。

从提示
    标有 From-Prompt 的选项将提示用户
    如果没有提供,则以交互方式获取参数。

从文件
    标有 From-File 的选项会将参数作为文件处理
    某些情况。

    如果初始参数为“-”,则最终参数为内容
    “标准输入”的。多个选项都可以指定“STDIN”,但相同
    内容将用于它们中的每一个。

    如果初始参数以“@”为前缀,则参数将是
    被视为文件的路径。该文件将被打开,并且
    contents 将用作最后一个参数。如果内容的
    无法读取文件,Swaks 将退出。指定文字值
    以“@”开头,使用两个“@”符号。第一个将是
    剥离。

敏感的
    如果标记为敏感的选项试图提示用户输入
    参数并且设置了“--protect-prompt”选项,Swaks 将
    尝试屏蔽用户输入以防止在终端上回显。
    Swaks 尝试以多种方式掩盖输入,但如果没有
    工作程序流程将继续使用未屏蔽的输入。

弃用
    标记为 Deprecated 的选项已被正式弃用,并将
    在未来的版本中被删除。请参阅“弃用”部分
    有关弃用的详细信息,请参阅此文档。

列出了使用每种类型的确切机制和格式
以下。

配置文件
    一个配置文件可以用来设置常用或异常
    详细选项。默认情况下,Swaks 按顺序查找
    $SWAKS_HOME/.swaksrc、$HOME/.swaksrc 和 $LOGDIR/.swaksrc。如果一个
    其中的那些被发现存在(并且“--config”尚未被使用)
    文件用作配置文件。

    此外,非默认位置的配置文件可以是
    使用“--config”指定。如果已设置且未给出参数
    Swaks 不会使用任何配置文件,包括任何默认值
    文件。如果“--config”指向一个可读文件,它被用作
    配置文件,覆盖可能存在的任何默认值。如果它
    指向一个不可读的文件,将显示一个错误,Swaks 将
    出口。

    也可以通过添加选项来创建一组“便携式”默认值
    到 Swaks 程序文件的末尾。作为分布式,最后一行
    Swaks 应该是“__END__”。在“__END__”之后添加的任何行都将
    被视为配置文件的内容。这允许
    自动从服务器复制的一组用户首选项
    服务器在一个文件中。

    如果未明确关闭配置文件,则
    “__END__”配置始终被读取。只有一个其他配置文件
    每次调用 Swaks 时都会使用,即使多次调用也是如此
    指定配置文件。如果“__END__”配置和
    要读取另一个配置,“__END__”配置将是
    先处理。指定不带参数的“--config”选项
    关闭“__END__”配置和任何实际的处理
    配置文件。

    在配置文件中,以散列 ("#") 开头的行是
    忽略。假定所有其他行都是 Swaks 的选项,其中
    前导破折号或破折号可选。选项后的一切
    行的第一个空格被假定为选项的参数,而不是
    外壳处理。因此,通常不需要引用
    字面上包括在论证中。

    提供选项与不提供选项之间存在细微差别
    参数并提供一个带有空参数的选项。如果
    选项行没有空格,整行被当作一个
    选项,没有参数。如果该行以一个空格结束,
    它将作为带有空参数的选项处理。所以,“贴切”
    将被视为“--apt”,但“apt”将被视为
    “--贴切”。

    以下是配置文件内容的示例:

        # 总是使用这个发件人,无论是服务器还是登录用户
        -- 来自 [email protected]
        # 我更喜欢我的测试邮件有一个漂亮的标题。笔记
        # 选项上没有破折号,周围也没有引号
        # 整个参数。
        h-来自:“Fred Example”<[email protected]>

    特定于配置文件的选项:

    --config [<配置文件>]
        此选项提供特定配置文件的路径以
        使用。如果没有参数指定,则不会自动找到
        配置文件(通过 $HOME 等,或“__END__”)将是
        处理。如果参数是有效文件,则该文件将是
        用作配置文件(在“__END__”配置之后)。如果
        argument 不是一个有效的、可读的文件,Swaks 将报错并且
        出口。可以多次指定此选项,但只能指定
        第一次指定(在环境变量和
        命令行搜索顺序)将被使用。(Arg-可选)

配置环境变量
    可以通过环境变量提供选项。变量是
    形式为 $SWAKS_OPT_name,其中“name”是选项的名称
    这将在命令行上指定。因为破折号不是
    在大多数 UNIX-ish shell 中允许出现在环境变量名称中,否
    应使用前导破折号和选项内的任何破折号
    名称应替换为下划线。以下将创建
    配置文件示例中显示的相同选项:

        $ SWAKS_OPT_from='[email protected]'
        $ SWAKS_OPT_h_From='"Fred Example" <[email protected]>'

    将变量设置为空值与在
    没有参数的命令行。例如,设置
    <SWAKS_OPT_server=""> 会让 Swaks 提示用户输入
    每次调用时要连接的服务器。

    因为设置提供的选项没有固有顺序
    环境变量,选项在被排序之前
    处理。这不是一个很好的解决方案,但它至少定义了
    行为,否则将是未定义的。例如,如果两者
    $SWAKS_OPT_from 和 $SWAKS_OPT_f 已设置,值来自
    将使用 $SWAKS_OPT_from,因为它排在 $SWAKS_OPT_f 之后。
    也是由于环境中没有固有的秩序
    处理、取消设置带有“no-”前缀的选项是不可靠的。
    如果关闭的选项在“no-”之前排序,它会起作用,但是
    如果排序之后失败。因为“no-”主要是为了操作
    配置类型之间(例如,从命令行取消设置
    在配置文件中设置的选项),这不太可能是
    问题。

    除了设置命令行选项的等效项外,
    $SWAKS_HOME 可以设置为包含默认值的目录
    .swaksrc 被使用。

命令行选项
    向 Swaks 提供选项的最后一种方法是通过命令
    线。这些选项的行为方式与大多数 UNIX-ish 一致
    命令行程序。许多选项都有短格式和长格式
    (例如“-s”和“--server”)。按照惯例,空头期权是
    用单个破折号指定,长选项用
    双破折号。这只是一个约定,任何一个前缀都可以
    无论哪种类型。

    下面演示配置中显示的示例
    文件和环境变量部分:

        $ swaks --from [email protected] --h-From: '"Fred Example" <[email protected]>'

Transport
Swaks may connect to a target
socket through a UNIX pipe (a "pipe"), a UNIX domain (a "UNIX socket"), or an Internet domain socket (a "network
socket"). Connecting via a network socket is the default behavior.
Due to the unique nature of the vehicles used,
the options in each group below are mutually exclusive. Specifying more
of one of "--server", "--pipe" or "--socket" will result in an error.
Mixing other options between transport types will only cause
irrelevant options to be ignored. Below is a brief description of each
transfer type and the options specific to that transfer
type.

网络套接字
    此传输尝试通过 TCP/IP 传送消息,
    传送 SMTP 的标准方法。这是默认传输
    对于斯瓦克斯。如果没有给出“--server”、“--pipe”或“--socket”
    然后使用此传输并从中确定目标服务器
    收件人的域(有关更多详细信息,请参见下面的“--server”)。

    此传输需要 IO::Socket 模块,它是
    标准的 Perl 发行版。如果此模块不可加载,
    尝试使用此传输将导致错误和程序
    终止。

    存在 IO::Socket::INET6 模块时支持 IPv6。

    -s, --server [<目标服务器>[:<端口>]]
        明确告诉 Swaks 使用网络套接字并指定
        要连接的主机名或 IP 地址,如果没有则提示
        给出论据。如果没有给出这个选项并且没有其他
        给出传输选项,确定目标邮件服务器
        来自收件人域的适当 DNS 记录
        使用 Net::DNS 模块的电子邮件地址。如果 Net::DNS 不是
        可用的 Swaks 将尝试连接到本地主机进行传送。
        可以选择在此处设置目标端口。支持格式
        为此包括 SERVER:PORT (支持名称和 IPv4
        地址);[SERVER]:PORT 和 SERVER/PORT(支持名称,
        IPv4 和 IPv6 地址)。另见“--copy-routing”。
        (Arg-必需,来自提示)

    -p, --port [<端口>]
        指定要使用目标上的哪个 TCP 端口,或者提示是否
        没有列出任何参数。参数可以是服务名称(如
        通过 getservbyname(3)) 或端口号检索。默认的
        端口为 smtp/25,除非受“--protocol”或
        “--tls-on-connect”选项。(Arg-必需,来自提示)

    -li, --local-interface [<本地接口>[:<端口>]]
        使用参数作为传出 SMTP 的本地接口
        连接,如果没有给出参数则提示用户。参数可以是
        IP 地址或主机名。默认操作是让
        操作系统选择本地界面。请参阅“--server”
        关于 :<port> 格式的附加评论。(Arg-必需,
        从提示)

    -lp, --local-port, --lport [<端口>]
        指定发出请求的传出端口
        交易。参数可以是服务名称(由
        getservbyname(3)) 或端口号。如果没有这个选项
        指定系统将选择一个临时端口。注意
        普通用户无法指定某些端口。(Arg-必需,
        从提示)

    --copy-routing <域>
        该参数被解释为电子邮件的域部分
        地址,它用于查找使用相同的目标服务器
        用于查找目标服务器的逻辑
        收件人电子邮件地址。有关更多详细信息,请参见“--to”选项
        如何从电子邮件域确定目标。
        (Arg-必需)

    -4, -6
        强制使用 IPv4 或 IPv6。(Arg-无)

UNIX 套接字
    此传输方法尝试通过 UNIX 域传递消息
    套接字文件。这对于测试监听的 MTA/MDA 很有用
    套接字文件(例如,测试 LMTP 传送到 Cyrus)。这
    传输需要 IO::Socket 模块,它是
    标准的 Perl 发行版。如果此模块不可加载,
    尝试使用此传输将导致错误和程序
    终止。

    --socket [<套接字文件>]
        该选项将一个 UNIX 域套接字文件作为其参数。如果
        Swaks 无法打开此套接字,它会显示错误并且
        出口。(Arg-必需,来自提示)

管道
    此传输尝试生成一个进程并与之通信
    通过管道。生成的程序必须准备好充当邮件
    服务器通过“STDIN”/“STDOUT”。任何设计用于从
    inet/xinet 应该支持这个。此外,一些 MTA 提供
    可以通过“STDIN”/“STDOUT”进行通信的测试模式。
    此传输可用于自动执行该测试。例如,如果
    您使用 Exim 实施了 DNSBL 检查并且您想确保
    它正在运行,您可以运行“swaks --pipe “exim -bh 127.0.0.2””。
    理想情况下,您正在与之交谈的进程应该表现得完全一样
    “STDIN”和“STDOUT”上的 SMTP 服务器。应发送任何调试
    到“STDERR”,这将被定向到您的终端。在实践中,
    Swaks 通常可以在孩子的“STDOUT”上处理一些调试,但是
    无法保证它可以处理多少。

    此传输需要 IPC::Open2 模块,它是
    标准的 Perl 发行版。如果此模块不可加载,
    尝试使用此传输将导致错误和程序
    终止。

    --pipe [<命令和参数>]
        为进程提供进程名称和参数。斯沃克斯将
        尝试生成进程并通过管道与其通信。
        如果参数不是可执行文件,Swaks 将显示错误
        并退出。(Arg-必需,来自提示)

Protocol Options
These options are related to the protocol layer.

-t, --to [<电子邮件地址>[,<电子邮件地址>[,...]]]
    告诉 Swaks 使用参数作为信封接收者
    电子邮件,如果没有提供参数,则提示收件人。如果多个
    提供了收件人并且需要收件人域
    确定路由使用最后提供的收件人的域。

    此选项没有默认值。如果没有收件人
    通过任何方式提供,用户将被提示提供一个
    交互地。唯一的例外是如果“--quit-after”
    提供的值将导致 SMTP 事务
    在需要接收者之前终止。(Arg-必需,
    从提示)

-f, --from [<电子邮件地址>]
    使用参数作为电子邮件的信封发件人,如果没有则提示用户
    指定的参数。可以提供字符串“<>”来表示 null
    发件人。如果用户未指定发件人地址,则默认值为
    用过的。默认发件人的域部分是对
    本地主机的完全限定域名。的方法
    确定本地部分会有所不同。在 Windows 上,“Win32::LoginName()”
    用来。在 UNIX-ish 平台上,$LOGNAME 环境变量是
    如果已设置则使用。否则使用 getpwuid(3)。也可以看看
    “--force-getpwuid”。如果 Swaks 无法确定本地主机名并且
    交易需要发件人地址,Swaks 会报错
    并退出。在这种情况下,必须通过此提供有效的字符串
    选项。(Arg-必需,来自提示)

--ehlo, --lhlo, -h, --helo [<helo-string>]
    用作 HELO/EHLO/LHLO 命令或提示用户的参数的字符串
    如果没有指定参数。如果未使用此选项,则为最佳猜测
    使用本地主机的完全限定域名。如果
    Swaks 无法确定本地主机名并且 helo 字符串是
    交易需要,Swaks 将出错并退出。在这种情况下,
    必须通过此选项提供有效的字符串。(Arg-必需,
    从提示)

-q, --quit, --quit-after <停止点>
    事务应该停止的点。当要求
    在交易中达到停止点,并且前提是
    Swaks 在到达之前没有出错,Swaks 将发送
    “QUIT”并尝试干净地关闭连接。这些是
    有效的论据和关于其含义的注释。(Arg-必需)

    连接,横幅
        收到来自的问候横幅后终止会话
        目标。

    FIRST-HELO, FIRST-EHLO, FIRST-LHLO
        在 STARTTLS(但不是 tls-on-connect)会话中,终止
        两个 HELO 中的第一个之后的交易。在非 STARTTLS
        交易,行为与 HELO 相同(见下文)。

    X客户端
        发送 XCLIENT 后退出。

    开始TLS,TLS
        在 TLS 协商后立即退出事务。笔记
        这取决于是否发生在不同的地方
        使用 STARTTLS 或 tls-on-connect。这总是在之后退出
        协商 TLS 的点,无论
        是否尝试过。

    HELO、EHLO、LHLO
        在 STARTTLS 或 XCLIENT 会话中,在第二个 HELO 后退出。
        否则在第一个也是唯一的 HELO 之后退出。

    授权
        认证后退出。这总是在点后退出
        在何处协商身份验证,无论
        是否尝试过。

    邮件,发件人
        MAIL FROM: 发送后退出。

    收货人,收件人
        发送 RCPT TO: 后退出。

--da, --drop-after <停止点>
    该选项类似于“--quit-after”,但不是尝试
    干净地关闭会话它只是终止会话。这
    选项接受与“--quit-after”相同的停止点,并且
    另外接受 DATA 和 DOT,详情如下。(Arg-必需)

    数据
        发送数据后退出。

    DOT 在最后一个 '.' 后退出 的消息被发送。

--das, --drop-after-send <停止点>
    此选项类似于“--drop-after”,但不是丢弃
    读取对停止点的响应后,连接断开
    发送停止点后立即连接。它接受
    与“--drop-after”相同的停止点。(Arg-必需)

--超时[<时间>]
    使用参数作为 SMTP 事务超时,如果没有则提示用户
    给出的论据。参数可以是一个纯数字,它将是
    解释为秒,或者可以有说明符 s、m 或 h(5s = 5
    秒,3m = 180 秒,1h = 3600 秒)。作为特殊情况,0
    意味着不要使交易超时。默认值为 30 秒。
    (Arg-必需,来自提示)

--协议<协议>
    指定要在事务中使用的协议。有效选项是
    如下表所示。目前的“核心”协议是 SMTP,
    ESMTP 和 LMTP。通过使用这些协议类型的变体,人们可以
    简洁地指定默认端口,是否应该进行身份验证
    已尝试,以及应尝试的 TLS 连接类型。
    默认协议是 ESMTP。下表说明了
    “--protocol”的可用参数和每个选项设置为
    副作用。(Arg-必需)

    邮件传输协议
        你好,“-p 25”

    SSMTP
        EHLO->HELO, "-tlsc -p 465"

    SSMTPA
        EHLO->HELO, "-a -tlsc -p 465"

    SMTPS
        你好,“-tlsc -p 465”

    ESMTP协议
        EHLO->HELO, "-p 25"

    ESMTPA
        EHLO->HELO, "-a -p 25"

    ESMTPS
        EHLO->HELO, "-tls -p 25"

    ESMTPSA
        EHLO->HELO, "-a -tls -p 25"

    LMTP
        LHLO,“-p 24”

    LMTPA
        LHLO, "-a -p 24"

    LMTPS
        LHLO, "-tls -p 24"

    LMTPSA
        LHLO, "-a -tls -p 24"

- 管道
    如果远程服务器支持,尝试 SMTP PIPELINING (RFC
    2920)。(Arg-无)

--pdr
    如果服务器支持,尝试 Per-Recipient Data Response
    (PRDR) (<https://tools.ietf.org/html/draft-hall-prdr-00.txt>)。PRDR
    尚未标准化,但 MTA 已开始实施
    提议。(Arg-无)

--force-getpwuid
    告诉 Swaks 使用 getpwuid 方法查找默认发件人
    local-part 而不是先尝试 $LOGNAME 。(Arg-无)

TLS/Encryption
These are options related to crypto trading. These have
been tested and confirmed to be suitable for all three modes of transport. The
Net::SSLeay module is used to perform encryption on request.
If this module is not loadable, Swaks will ignore TLS requests
or error, depending on whether the request is optional. STARTTLS is
defined as an extension in the ESMTP protocol if
"--protocol" is set to a variant of SMTP. Because it is not defined in
the protocol itself, "--tls-on-connect" can be used with any protocol type
if the target supports it.

TLS 连接不需要本地证书
谈判。但是,某些服务器使用客户端证书检查来
验证是否允许客户端连接。可以告诉 Swaks 使用
使用“--tls-cert”和“--tls-key”的特定本地证书
选项。

-tls
    需要连接才能使用 STARTTLS。如果 TLS 不可用则退出
    任何原因(未公布、谈判失败等)。(Arg-无)

-tlso, --tls-可选
    尝试使用 STARTTLS(如果可用),继续正常
    如果由于任何原因无法协商 TLS,则交易。笔记
    这是目前实施的半无用选项,因为
    协商失败后,连接状态未知。
    在某些情况下,如版本不匹配,连接应该是
    保留为明文。在其他情况下,例如验证失败,
    服务器端可能认为它应该继续使用 TLS,而
    客户端认为它是明文。可能会尝试添加更多
    将来会进行粒度状态检测,但现在请注意
    如果 TLS 协商,这个选项可能会发生奇怪的事情
    被尝试但失败了。(Arg-无)

-tlsos, --tls-可选-严格
    尝试使用 STARTTLS(如果可用)。继续交易,如果
    TLS 协商成功或 STARTTLS 未通告。如果
    通告 STARTTLS 但 TLS 协商失败,视为错误
    并中止交易。由于上面提到的警告,这是一个很
    比“--tls-optional”更明智的选择。(Arg-无)

-tlsc, --tls-on-connect
    连接时立即启动 TLS 连接。下列的
    通用约定,如果指定此选项则为默认端口
    从 25 变为 465,尽管这仍然可以被覆盖
    --端口选项。(Arg-无)

-tlsp, --tls-protocol <tls-version-specification>
    指定协商 TLS 时要使用(或不使用)的协议。在
    在撰写本文时,可用的协议是 sslv2、sslv3、
    tlsv1、tlsv1_1、tlsv1_2 和 tlsv1_3。这些的可用性
    protocols 依赖于你的底层 OpenSSL 库,所以不
    所有这些都可能可用。可用协议列表是
    显示在“--dump”的输出中(假设 TLS 完全可用)。

    规范字符串是一个以逗号分隔的协议列表,
    可以用也可以不用。例如 'tlsv1,tlsv1_1' 只会
    如果这两个协议之一在两者上都可用,则成功
    客户端和服务器。相反,'no_sslv2,no_sslv3' 将尝试
    协商除 sslv2 和 sslv3 之外的任何协议。的两种形式
    规格不能混用。(Arg-必需)

--tls-cipher <密码字符串>
    此选项的参数传递给底层 OpenSSL
    用于设置可接受密码列表的库
    联系。这个字符串的格式对 Swaks 是不透明的,并且是
    定义于
    <http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT>。
    一个简短的例子是“--tls-cipher '3DES:+RSA'”。(Arg-必需)

--tls-验证
    告诉 Swaks 尝试验证服务器的证书。如果这
    选项已设置且服务器的证书不可验证(要么
    使用系统默认 CA 信息或自定义 CA 信息
    (参见“--tls-ca-path”))TLS 协商不会成功。默认情况下,
    Swaks 不会尝试证书验证。(Arg-无)

--tls-ca-path <ca-location>
    指定用于验证的 CA 信息的备用位置
    服务器证书。参数可以指向文件或目录。
    默认行为是使用底层 OpenSSL 库的
    默认信息。(Arg-必需)

--tls-cert <证书文件>
    提供包含本地证书 Swaks 的文件的路径
    如果协商 TLS,应该使用。文件路径参数是必需的。
    目前实施的文件中的证书必须在 PEM 中
    格式。如果迫切需要 ASN1,请联系作者。如果
    此选项已设置,还需要“--tls-key”。(Arg-必需)

--tls-key <密钥文件>
    提供包含本地私钥 Swaks 的文件的路径
    如果协商 TLS,应该使用。文件路径参数是必需的。
    目前实施的文件中的证书必须在 PEM 中
    格式。如果迫切需要 ASN1,请联系作者。如果
    此选项已设置,还需要“--tls-cert”。(Arg-必需)

--tls-get-peer-cert [<输出文件>]
    获取 TLS 对等方证书的副本。如果没有给出参数,
    它将显示到“STDOUT”。如果给出一个参数,它是
    假定为指定证书所在位置的文件系统路径
    应该写。然后可以使用检查保存的证书
    标准工具,例如 openssl 命令。如果指定了一个文件
    它的内容将被覆盖。(Arg-可选)

--tls-sni <sni-string>
    指定服务器名称指示字段发送时 TLS
    连接被启动。(Arg-必需)

Authentication
Swaks will attempt to authenticate to the target mail server if
instructed to do so. This section details the available authentication
types, requirements, options, and their interactions, as well as other fine
points for using authentication. Because authentication is defined as
an extension in the ESMTP protocol it will not be available if "--protocol"
is set to a variant of SMTP.

所有身份验证方法都需要 base64 编码。如果 MIME::Base64
Perl 模块是可加载的 Swaks 试图用它来执行这些
编码。如果 MIME::Base64 不可用,Swaks 将使用自己的
板载 base64 例程。这些比 MIME::Base64 例程慢
尽管已经过彻底测试,但审查较少。使用
鼓励使用 MIME::Base64 模块。

如果需要身份验证(请参阅下面的选项以了解何时和
不需要)并且不满足身份验证的要求
类型可用,Swaks 显示错误并退出。这可以通过两种方式
发生的情况包括强制 Swaks 使用特定的身份验证类型
由于缺少要求或允许 Swaks 使用,Swaks 无法使用
任何身份验证类型,但服务器仅通告类型 Swaks
不能支持。在前一种情况下,Swaks 在期权处理时出错
时间因为它预先知道它将无法进行身份验证。在里面
后一种情况 Swaks 将在 SMTP 的身份验证阶段出错
交易,因为 Swaks 不会意识到它无法
验证直到那一点。

以下是支持的身份验证类型,包括任何
个别说明和要求。

以下选项会影响 Swaks 对身份验证的使用。这些选项
都是相互关联的。例如,指定“--auth-user”意味着
“--auth”和“--auth-password”。指定“--auth-optional”意味着
“--auth-user”和“--auth-password”等。

-a, --auth [<授权类型>[,<授权类型>[,...]]]
    要求 Swaks 进行身份验证。如果没有给出参数,任何
    尝试服务器公布的支持的身份验证类型,直到一个
    成功或全部失败。如果将一种或多种身份验证类型指定为
    参数,服务器也支持的每个参数都按顺序尝试,直到
    一个成功或全部失败。此选项需要 Swaks
    进行身份验证,因此如果未找到常见的身份验证类型或没有凭据
    成功,Swaks 显示错误并退出。(Arg-可选)

    下表列出了有效的身份验证类型

    登录,普通
        这些基本身份验证类型得到完全支持和测试
        并且没有额外要求

    CRAM-MD5
        CRAM-MD5 验证器需要 Digest::MD5 模块。它
        经过全面测试,相信适用于任何服务器
        实施它。

    摘要-MD5
        DIGEST-MD5 验证器 (RFC2831) 需要 Authen::SASL
        模块。版本 20100211.0 及更早版本使用 Authen::DigestMD5
        它有一些协议级别的错误,阻止了它
        使用一些服务器。Authen::SASL 的 DIGEST-MD5 处理是
        更健壮。

        Swaks 中的 DIGEST-MD5 实现相当不成熟。它
        例如,当前仅支持“auth”qop 类型。如果
        你有 DIGEST-MD5 经验并愿意帮助 Swaks
        更好地支持 DIGEST-MD5,请与我联系。

        DIGEST-MD5 协议的“领域”值可以使用
        “--auth-extra”“领域”关键字。如果没有给出领域,一个
        将使用合理的默认值。

        DIGEST-MD5 协议的“digest-uri”值可以使用
        “--auth-extra”选项。例如,您可以创建
        “lmtp/mail.example.com/example.com”的 digest-uri-value 与
        选项“--auth-extra
        dmd5-serv-type=lmtp,dmd5-host=mail.example.com,dmd5-serv-name=ex
        ample.com”。“digest-uri-value”字符串及其组件是
        在 RFC2831 中定义。如果没有给出这些值,
        将使用合理的默认值。

    CRAM-SHA1
        CRAM-SHA1 验证器需要 Digest::SHA 模块。
        此类型仅针对非标准测试
        在 Exim 服务器上实现,因此可能有一些
        实施缺陷。

    NTLM/SPA/MSN
        这些验证器需要 Authen::NTLM 模块。注意
        有两个模块使用 CPAN 上的 Authen::NTLM 命名空间。
        Mark Bush 实现 (Authen/NTLM-1.03.tar.gz) 是
        Swaks 所需的版本。这种类型已经过测试
        Exim、Communigate 和 Exchange 2007。

        除了标准的用户名和密码外,这
        身份验证类型也可以识别“域”。领域
        可以使用“--auth-extra”“域”关键字进行设置。注意
        这从未在没有的邮件服务器上进行过测试
        忽略 DOMAIN,因此这可能无法正确实现。

-ao, --auth-optional [<auth-type>[,<auth-type>[,...]]]
    此选项的行为与“--auth”相同,只是它请求
    身份验证而不是要求它。如果没有常见的身份验证类型
    找到或没有凭据成功,Swaks 继续进行身份验证
    没有被要求。(Arg-可选)

-aos, --auth-optional-strict [<auth-type>[,<auth-type>[,...]]]
    此选项是“--auth”和“--auth-optional”之间的折衷。
    如果没有找到常见的身份验证类型,Swaks 的行为就好像
    “--auth-optional”已指定并继续进行交易。
    如果 Swaks 不支持请求的身份验证类型,则服务器不支持
    通告任何常见的身份验证类型,或者如果没有凭据成功,Swaks
    表现得好像使用了“--auth”并因错误而退出。
    (Arg-可选)

-au, --auth-user [<用户名>]
    提供用于身份验证的用户名。如果没有用户名
    已提供,表示 Swaks 应尝试查找用户名
    通过 .netrc(需要 Net::Netrc 模块)。如果没有用户名
    提供但无法通过 .netrc 找到,将提示用户
    提供一个。可以提供字符串“<>”来表示空
    用户名。(Arg-必需,来自提示)

-ap, --auth-密码 [<密码>]
    提供用于身份验证的密码。如果没有密码
    已提供,表明 Swaks 应尝试查找密码
    通过 .netrc(需要 Net::Netrc 模块)。如果没有密码
    提供但无法通过 .netrc 找到,将提示用户
    提供一个。可以提供字符串“<>”来表示空
    密码。(Arg-Required, From-Prompt, Sensitive)

-ae, --auth-extra <键值对>[,<键值对>[,...]]
    一些身份验证类型允许额外的信息
    包括在认证过程中。而不是添加新选项
    对于每个身份验证器的每个角落,“--auth-extra”
    选项允许提供此信息。格式为
    <key-value-pair> 是 KEYWORD=VALUE。(Arg-必需)

    下表列出了当前识别的关键字和
    使用它们的验证器

    领域,领域
        领域和域关键字是同义词。使用任一个将
        在 NTLM/MSN/SPA 中设置“domain”选项和“realm”选项
        在 DIGEST-MD5 中

    dmd5-服务类型
        dmd5-serv-type 关键字由 DIGEST-MD5 使用
        身份验证器,部分用于构建
        digest-uri-value 字符串(参见 RFC2831)

    dmd5主机
        dmd5-host 关键字由 DIGEST-MD5 验证器使用
        并且部分地用于构建 digest-uri-value 字符串(请参阅
        RFC2831)

    dmd5-服务名称
        dmd5-serv-name 关键字由 DIGEST-MD5 使用
        身份验证器,部分用于构建
        digest-uri-value 字符串(参见 RFC2831)

-am, --auth-map <键值对>[,<键值对>[,...]]
    提供一种将备用名称映射到基本身份验证的方法
    类型。对任何使用通用替代名称的网站都很有用
    类型。<key-value-pair> 的格式是 AUTH-ALIAS=AUTH-TYPE。这
    功能实际上在内部用于映射类型 SPA 和 MSN
    到基本类型 NTLM 上。模拟这个的命令行参数
    将是“--auth-map SPA=NTLM,MSN=NTLM”。所有的授权类型
    上面列出的是除 SPA 和 MSN 之外的有效映射目标。
    (Arg-必需)

-apt, --auth-纯文本
    而不是按原样显示 base64 编码的 AUTH 字符串
    传输,在屏幕上打印之前将它们翻译成明文。
    (Arg-无)

-ahp, --auth-hide-password [<替换字符串>]
    如果指定了这个选项,任何时候一个可读的密码将是
    打印到终端(特别是 AUTH PLAIN 和 AUTH LOGIN)
    密码替换为字符串“PROVIDED_BUT_REMOVED”(或
    <replacement-string> 的内容(如果提供)。虚拟字符串可能
    或者可能不是 base64 编码,取决于“--auth-plaintext”
    选项。

    请注意,“--auth-hide-password”与
    “--protect-prompt”选项。前者保护密码免受
    无论它们如何显示在 SMTP 事务中
    进入。后者在用户键入时保护敏感字符串
    他们在终端,不管字符串将如何使用。
    (Arg-可选)

The X client option
XCLIENT is an SMTP extension introduced by the Postfix project. X Client
Allows (appropriately authorized) clients to tell the server to use alternate
client information, such as IP address or hostname. This allows for
an easier path to testing mail server configuration. Complete details
about the protocol are available at
http://www.postfix.org/XCLIENT_README.html .

每个 SMTP 可以多次将 XCLIENT 动词传递给服务器
具有不同属性的会话。例如,HELO 和 PROTO 可能是
在一次调用中传递,NAME 和 ADDR 在一秒钟内传递。因为它可以
对测试很有用,Swaks 公开了一些控制
属性被分组,并以什么顺序传递给服务器。
不同的选项试图为那些使用 Swaks 的人展示简单性
作为客户端,以及使用 Swaks 测试安装的复杂性。

--xclient-addr [<字符串>]
--xclient-name [<字符串>]
--xclient-port [<字符串>]
--xclient-proto [<字符串>]
--xclient-destaddr [<字符串>]
--xclient-destport [<字符串>]
--xclient-helo [<字符串>]
--xclient-login [<字符串>]
--xclient-reverse-name [<字符串>]
    这些选项指定应发送到
    目标服务器。如果未提供 <string>,Swaks 将提示并
    读取“STDIN”上的值。看
    <http://www.postfix.org/XCLIENT_README.html> 官方
    有关属性含义及其可能的文档
    值,包括特殊的“[UNAVAILABLE]”和“[TEMPUNAVAIL]”
    值。

    通过简单的例子,设置“--xclient-name foo.example.com
    --xclient-addr 192.168.1.1" 将导致 Swaks 发送 SMTP
    命令“XCLIENT NAME=foo.example.com ADDR=192.168.1.1”。

    请注意,“REVERSE_NAME”属性似乎没有出现在
    官方文档。有一个邮件列表线程
    记录它,可以在
    <http://comments.gmane.org/gmane.mail.postfix.user/192623>。

    这些选项都可以相互混合,并且可以混合
    使用“--xclient”选项(见下文)。默认所有属性
    将合并为一个 XCLIENT 调用,但请参阅“--xclient-delim”。
    (Arg-必需,来自提示)

--xclient-delim
    指定此选项时,它指示 XCLIENT 中的中断
    要发送的属性。例如,设置“--xclient-helo 'helo
    字符串' --xclient-delim --xclient-name foo.example.com
    --xclient-addr 192.168.1.1" 将使 Swaks 发送两个 XCLIENT
    调用,“XCLIENT HELO=helo+20string”和“XCLIENT
    NAME=foo.example.com ADDR=192.168.1.1”。这个选项被忽略
    它没有意义(在 XCLIENT 选项的开头或结尾,通过
    本身,连续等)。(Arg-无)

--xclient [<字符串>]
    这是“自由格式”XCLIENT 选项。无论提供什么价值
    for <string> 将作为参数逐字发送给 XCLIENT
    SMTP 命令。例如,如果“--xclient 'NAME= ADDR=192.168.1.1
    使用 FOO=bar'”,Swaks 将发送 SMTP 命令“XCLIENT NAME=
    ADDR=192.168.1.1 FOO=bar”。如果没有在命令行上传递参数,
    Swaks 将提示并读取 STDIN 上的值。

    与上面更具体的选项相比,这样做的主要优势
    是这里没有XCLIENT语法验证。这让你
    将无效的 XCLIENT 发送到目标服务器进行测试。
    此外,至少有一个 MTA(Message Systems 的 Momentum,以前称为
    ecelerity) 在不支持广告的情况下实现 XCLIENT
    属性。“--xclient”选项允许您跳过“支持的
    与此类 MTA 通信时检查属性”(尽管
    另见“--xclient-no-verify”)。

    “--xclient”选项可以与“--xclient-*”自由混合
    上面的选项。“--xclient”的参数将单独发送
    命令组。例如,如果“--xclient-addr 192.168.0.1
    --xclient-port 26 --xclient 'FOO=bar NAME=wind'" 给Swaks,
    “XCLIENT ADDR=192.168.0.1 PORT=26”和“XCLIENT FOO=bar NAME=wind”
    都将被发送到目标服务器。(Arg-必需,来自提示)

--xclient-no-verify
    不要强制要求 XCLIENT 属性必须是
    由服务器发布,以便 Swaks 在 XCLIENT 中发送它
    命令。这是为了支持不宣传的服务器
    属性,但仍然支持它们。(Arg-无)

--xclient-before-starttls
    如果 Swaks 配置为同时尝试 XCLIENT 和 STARTTLS,它将
    先做 STARTTLS。如果指定了此选项,它将尝试
    首先是 XCLIENT。(Arg-无)

--xclient-可选
--xclient-optional-strict
    在正常操作中,设置“--xclient*”选项之一将
    需要一个成功的 XCLIENT 事务才能发生,以便
    进行(即XCLIENT需要被通告,所有的
    用户请求的属性需要被公布,并且
    服务器需要接受 Swaks 的 XCLIENT 请求)。这些选项
    改变这种行为。“--xclient-optional”告诉 Swaks 继续
    无条件地通过 SMTP 事务的 XCLIENT 阶段,
    不管是否成功。“--xclient-optional-strict”
    相似但更细化。严格的版本将继续
    XCLIENT 未公布,但如果尝试 XCLIENT 将失败
    但没有成功。(Arg-无)

Proxy Options
Swaks implements the proxy protocol defined in
http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt . Proxy
Allows an application load balancer, such as HAProxy, to be used in
front of the MTA while still allowing the MTA to access the original
host information. Proxy support in Swaks allows direct testing of MTAs
configured to expect requests from a proxy, bypassing the proxy itself
during testing.

Swaks 不努力确保使用的代理选项是
内部一致。例如,“--proxy-family”(在版本 1 中)是
预期是“TCP4”或“TCP6”之一。虽然它可能不会
对目标服务器有意义,Swaks 没有尝试确保
“--proxy-source”和“--proxy-dest”与
“--proxy-family”或彼此。

“--proxy”选项与所有其他“--proxy-*”互斥
除“--proxy-version”之外的选项。

当不使用“--proxy”时,所有“--proxy-family”、“--proxy-source”、
“--proxy-source-port”、“--proxy-dest”和“--proxy-dest-port”是
必需的。此外,当“--proxy-version”为 2 时,“--proxy-protocol”
和“--proxy-command”是可选的。

--代理版本 [ 1 | 2]
    是使用版本 1(人类可读)还是版本 2(二进制)
    代理协议。版本 1 是默认值。版本 2 仅
    通过“地址块”实现,大致与
    版本 1 中提供的信息。

--proxy [<字符串>]
    如果使用此选项,则其参数在
    “PROXY”部分(或版本 2 的 12 字节协议头)
    代理交换。此选项允许发送不完整或
    格式错误的代理字符串到目标服务器进行测试。没有企图
    翻译或修改这个字符串,所以如果与
    “--proxy-version 2”参数应该在适当的二进制文件中
    格式。此选项与所有其他“--proxy-*”互斥
    提供细化代理信息的选项。(Arg-必需,
    从提示)

--proxy-family [<字符串>]
    对于版本 1,指定地址族和传输
    协议。该协议定义了 TCP4 和 TCP6。

    对于版本 2,仅指定地址族。协议
    定义 AF_UNSPEC、AF_INET、AF_INET6 和 AF_UNIX。(Arg-必需,
    从提示)

--proxy-protocol [<字符串>]
    对于版本 2,指定传输协议。协议
    定义 UNSPEC、STREAM 和 DGRAM。默认为流。这
    选项在版本 1 中未使用。(Arg-Required,From-Prompt)

--代理命令 [<字符串>]
    对于版本 2,指定传输协议。协议
    定义本地和代理。默认为代理。该选项未使用
    在版本 1 中。(Arg-Required,From-Prompt)

--proxy-source [<字符串>]
    指定代理连接的源地址。(Arg-必需,
    从提示)

--proxy-source-port [<字符串>]
    指定代理连接的源端口。(Arg-必需,
    从提示)

--proxy-dest [<字符串>]
    指定代理连接的目标地址。
    (Arg-必需,来自提示)

--proxy-dest-port [<字符串>]
    指定代理连接的目标端口。
    (Arg-必需,来自提示)

Data Options
These options relate to the contents of the data portion of the SMTP
transaction. By default a very simple message is sent. If "--attach"
or the "--attach-body" option is used, Swaks attempts to upgrade to MIME
information.

-d, --data [<数据部分>]
    使用 argument 作为 DATA 的全部内容。

    如果未提供参数,系统将提示用户提供值。

    如果提供参数“-”,数据将从“STDIN”读取
    没有提示。

    如果参数以“@”开头,它将被视为文件名。如果
    你想传递一个以“@”开头但不是
    一个文件名,在参数前面加上一个额外的“@”。例如,
    “@file.txt”将强制处理 file.txt。@@data 将使用
    字符串“@data”。

    如果参数不包含任何文字 (0x0a) 或
    代表 (0x5c, 0x6e or %NEWLINE%) 换行符,它会
    被视为文件名。如果文件是可打开的,则内容
    该文件将用作数据部分。如果文件不能
    打开后,Swaks 会出错并退出。中描述的整个行为
    这一段已被弃用,将来会被删除
    发布。而是使用前导“@”来明确设置
    参数是一个文件名。

    任何其他参数将用作 DATA 内容。

    该值可以在一行中,带有“\n”(ASCII 0x5c、0x6e)
    表示应放置换行符的位置。前导点将
    被引用。结束点不是必需的,但允许使用。默认的
    此选项的值为“日期:%DATE%\n收件人:%TO_ADDRESS%\n发件人:
    %FROM_ADDRESS%\n主题:测试 %DATE%\n消息 ID:
    <%MESSAGEID%"\nX-Mailer:swaks v%SWAKS_VERSION%
    jetmore.org/john/code/swaks/\n%NEW_HEADERS%\n%BODY%\n>。

    在 DATA 部分执行非常基本的令牌解析。这
    下表显示了已识别的令牌及其替换
    值。(Arg-Required, From-Prompt, From-File)

    %FROM_ADDRESS%
        替换为信封发件人。

    %讲话%
        替换为信封收件人。

    %日期%
        以适合的格式替换为当前时间
        包含在 Date: 标头中。请注意,这会尝试使用
        用于时区计算的标准模块 POSIX。如果这个模块
        不可用,日期字符串将采用格林威治标准时间。

    %MESSAGEID%
        替换为适用于
        消息 ID 标头。该令牌的价值将保持不变
        在进程的生命周期内保持一致。

    %SWAKS_VERSION%
        替换为当前运行的 Swaks 的版本
        过程。

    %NEW_HEADERS%
        替换为“--add-header”选项的内容。如果
        “--add-header” 未指定此标记只是被删除。

    %身体%
        替换为“--body”选项指定的值。看
        默认为“--body”。

    %新队%
        替换为回车、换行 (0x0d, 0x0a)。这是
        与使用“\n”(0x5c、0x6e)相同,但没有
        避免反斜杠可能在换行符上引起的担忧。

-dab, --dump-as-body [<部分>[,<部分>[,...]]]
    如果使用“--dump-as-body”并且没有使用其他选项来更改
    消息的默认正文,正文替换为输出
    类似于“--dump”提供的输出。“--转储”的
    不显示初始程序能力节,并且“数据”
    部分不包括在内。此外,“--dump”总是包括
    密码。默认情况下“--dump-as-body”不包括密码,
    虽然这可以用“--dump-as-body-shows-password”来改变。
    “--dump-as-body”采用与“--dump”相同的参数,除了
    不支持 SUPPORT 和 DATA 参数。(Arg-可选)

-dabsp, --dump-as-body-shows-password
    导致“--dump-as-body”包含明文密码。这个选项
    不推荐。此选项暗示“--dump-as-body”。(Arg-无)

--body [<body-specification>]
    指定电子邮件的正文。默认是“这是一个测试
    邮寄”。如果没有给出“--body”的参数,提示提供一个
    交互地。如果提供“-”,主体将从
    标准输入。以“@”开头的参数将被视为
    包含要使用的正文数据的文件名(有关更多信息,请参见“--data”
    细节)。

    如果经过上述处理后,参数代表一个open-able
    文件,该文件的内容用作正文。这是
    已弃用的行为,将在未来的版本中删除。反而
    使用前导“@”明确设置参数为文件名。

    如果邮件被强制为 MIME 格式(请参阅“--attach”)“--body
    '正文'”与“--attach-type text/plain --attach-body
    '正文'”。有关创建正文的详细信息,请参阅“--attach-body”
    多部分/替代正文。(Arg-Required, From-Prompt, From-File)

--attach [<附件规范>]
    当提供一个或多个“--attach”选项时,消息是
    更改为多部分/混合 MIME 消息。的论点
    “--attach”的处理方式与“--body”相同
    “STDIN”、文件内容等。“--attach”可以提供多个
    次创建多个附件。默认情况下,每个附件都是
    作为应用程序/八位字节流文件附加。参见“--attach-type”
    为了改变这种行为。

    如果附件的内容是通过文件名提供的,则
    MIME 编码将包括该文件名。请参阅“--attach-name”
    有关文件命名的更多详细信息。

    将“-”(“STDIN”)指定为参数是合法的
    多次(一次用于“--body”,多次用于
    “ - 附”)。在这种情况下,将附加相同的内容
    指定的时间。这对于附加相同的内容很有用
    具有多种 MIME 类型。(需要参数,来自文件)

--attach-body [<body-specification>]
    这是专门针对身体的“--attach”的变体
    电子邮件的一部分。它的行为与“--attach”相同,因为它
    采用相同的参数并强制创建 MIME 消息。
    但是,它的不同之处在于,论证始终是
    消息中的第一个 MIME 部分,无论在选项处理的哪个位置
    它遇到的顺序。此外,“--attach-body”选项堆栈
    允许创建多部分/替代机构。例如,
    "--attach-type text/plain --attach-body '纯文本正文'
    --attach-type text/html --attach-body 'html body'" 会创建一个
    多部分/替代消息体。(需要参数,来自文件)

--attach-type <mime 类型>
    默认情况下,将 MIME 附加到带有
    “--attach”选项被编码为 application/octet-stream(除了
    正文,默认情况下是文本/纯文本)。“--attach-type”变化
    它后面的每个“--attach”选项的 mime 类型。它可以
    被指定多次。当前 MIME 类型重置为
    处理身体部位和其他部位之间的应用程序/八位字节流
    部分。(Arg-必需)

--attach-name [<名称>]
    此选项设置将包含在 MIME 部分中的文件名
    为下一个“--attach”选项创建。如果没有设置参数
    这个选项,它会导致不包含文件名信息
    下一个 MIME 部分,即使 Swaks 可以从本地生成它
    文件名。(Arg-可选)

-ah, --add-header <标题>
    此选项允许将标头添加到 DATA。如果
    “%NEW_HEADERS%”出现在数据中,它被替换为
    此选项的参数。如果“%NEW_HEADERS%”不存在,则
    参数插入在前两个连续的换行符之间
    DATA(也就是说,它被插入到现有的末尾
    标头)。

    该选项可以指定多次或一次
    多个标头由文字“\n”字符串分隔。所以,
    “--add-header 'Foo: bar' --add-header 'Baz: foo'”和“--add-header
    'Foo: bar\nBaz: foo'" 最终添加了相同的两个标头。
    (Arg-必需)

--header <header-and-data>, --h-<header> <data>
    这些选项允许更改已经存在于
    数据。“--header 'Subject: foo'”和“--h-Subject foo”是
    相等的。如果数据中不存在标头,则
    此参数的行为与“--add-header”相同。但是,如果
    header 已经存在,它被替换为指定的。
    使用标题名称否定此选项的版本
    选项(例如“--no-header-Subject”)将删除所有以前
    处理的“--header”选项,而不仅仅是用于“主题”的选项。
    (Arg-必需)

-g 此选项是“--data -”的直接别名(从
    “标准输入”)。它完全次于“--data”。任何发生
    “--data”将导致“-g”被忽略。这个选项不能
    用“no-”前缀否定。此选项已弃用,将
    在未来版本的 Swaks 中删除。(Arg-None,已弃用)

--no-data-fixup, -ndf
    此选项强制 Swaks 不对 DATA 部分进行任何处理
    电子邮件。这包括令牌替换、From_ 剥离、
    尾随点添加、“--body”/附件包含和任何标题
    添加。此选项仅在与“--data”一起使用时有用,因为
    内部默认数据部分使用令牌。(Arg-无)

--no-strip-from, -nsf
    不要从 DATA 部分删除 From_ 行(如果存在)。
    (Arg-无)

Output options
Swaks provide callers with a record of their transactions
by default ("STDOUT"/"STDERR"). This transcript aims to faithfully
represent the transaction as closely as possible, although it does modify this
by adding an info prefix to the line and providing
a cleartext version of the TLS transaction

“信息前缀”被称为事务提示。这些
提示最初由那些输出的标记行组成
Swaks 本身,无论是信息性消息还是错误消息,以及那些
指示在事务中实际发送或接收的一行数据。这
表表示提示及其含义:

“===”
    指示由 Swaks 生成的信息行。

“***”
    指示在 Swaks 中生成的错误。

“->”
    指示 Swaks 发送到目标服务器的预期行。

“~>”
    指示 Swaks 发送到目标的 TLS 加密预期行
    服务器。

“**>”
    指示 Swaks 发送到目标服务器的意外行。

“*~>”
    指示 Swaks 发送到目标的 TLS 加密的意外行
    服务器。

“>”
    指示 Swaks 发送到目标服务器的原始文本块(请参阅
    “--显示原始文本”)。没有“预期”或“预期”的概念
    这个级别的“意外”。

“<-”
    指示目标服务器发送给 Swaks 的预期行。

“<~”
    指示目标服务器发送到的 TLS 加密的预期行
    斯瓦克斯。

“<**”
    指示目标服务器向 Swaks 发送的意外行。

“<~*”
    指示目标服务器发送到的 TLS 加密的意外行
    斯瓦克斯。

“<”
    指示 Swaks 从目标服务器接收到的原始文本块
    (参见“--show-raw-text”)。没有“预期”或“预期”的概念
    这个级别的“意外”。

以下选项控制输出内容和方式显示给
呼叫者。

-n, --抑制数据
    总结 SMTP 事务的数据部分而不是
    打印每一行。这个选项非常有用,接近于
    需要,当使用 Swaks 发送某些测试电子邮件时。电子邮件与
    例如,附件将很快淹没终端,如果
    DATA 未被抑制。(Arg-无)

-stl, --show-time-lapse [i]
    显示发送/接收对之间的时间间隔。这个选项最
    当 Time::HiRes 可用时很有用,在这种情况下时间流逝
    将以千分之一秒显示。如果 Time::HiRes 是
    不可用或“i”作为参数给出失效将是
    仅以整数秒显示。(Arg-可选)

-nih, --no-info-hints
    不显示信息交易的交易提示。
    这在需要复制文件的某些部分时最有用
    信息行,例如证书输出
    “--tls-get-peer-cert”。(Arg-无)

-nsh, --no-发送提示
-nrh, --no-receive-hints
-nth, --no-hints
    “--no-send-hints”和“--no-receive-hints”抑制交易
    分别来自发送和接收行的提示。这经常
    在复制交易的某些部分以供使用时很有用
    其他地方(例如,“--no-send-hints --hide-receive
    --hide-informational" 是仅获取客户端的有用方法
    给定事务的命令)。"--no-hints" 等同于
    同时指定“--no-send-hints”和“--no-receive-hints”。
    (Arg-无)

-raw, --show-raw-text
    此选项将打印由发送和接收的原始数据的十六进制转储
    斯瓦克斯。每个十六进制转储都是一次读取或写入的内容
    网络。这应该与已经存在的相同
    显示(除了“\r”字符被删除)。
    此选项在服务器发送时查看详细信息很有用
    单个数据包中的大量数据,或将单行分解为
    多个数据包。如果你真的需要深入那个领域
    你可能更适合使用数据包嗅探器,但这个选项是
    看到奇怪的连接问题的良好第一步。(Arg-无)

--output, --output-file <文件路径>
--output-file-stdout <文件路径>
--output-file-stderr <文件路径>
    这些选项允许用户将输出发送到文件而不是
    “标准输出”/“标准错误”。第一个选项将两者发送到同一个文件。这
    &STDOUT 和 &STDERR 的参数被特殊处理,参考
    “普通”文件句柄,所以“--output-file-stderr '&STDOUT'”会
    将“STDERR”重定向到“STDOUT”。所有人都尊重这些选择
    除了“--help”和“--version”之外的输出。(Arg-必需)

-pp, --protect-提示
    不要在可能敏感的提示上回显用户输入
    (现在只有认证密码)。非常具体,任何
    标记为“敏感”并最终提示输入的选项
    争论将尽最大努力掩盖该争论不被回应。
    另见“--auth-hide-password”。(Arg-无)

-hr, --隐藏接收
    不要显示正在接收的从远程服务器发送的行
    斯瓦克斯。(Arg-无)

-hs, --隐藏发送
    不要显示 Swaks 发送到远程服务器的行。
    (Arg-无)

-hi, --hide-informational
    不要显示来自 Swaks 本身的非错误信息行。
    (Arg-无)

-ha, --hide-all
    不向终端显示任何内容。(Arg-无)

-S, --沉默 [ 1 | 2 | 3]
    让斯瓦克斯沉默不语。如果没有给出参数或者如果有参数
    给出了“1”,除非/直到发生错误,否则不打印任何输出,之后
    显示所有输出。如果给出参数“2”,则仅
    打印错误。如果给出“3”,则永远不显示任何输出。“ - 沉默的”
    影响大部分输出但不是全部。例如,“--help”,
    “--version”、“--dump”和“--dump-mail”不受影响。
    (Arg-可选)

- 支持
    打印功能并退出。某些功能需要非标准
    Perl 模块。该选项评估这些模块是否
    呈现并显示哪些功能可用,哪些
    不是,需要添加哪些模块才能获得缺失的
    功能。(Arg-无)

--转储邮件
    使 Swaks 处理所有选项以生成它会生成的消息
    发送,然后将该消息打印到“STDOUT”而不是发送它。
    此输出与“--dump”的“数据”部分相同,除了
    没有尾随点。(Arg-无)

--dump [<部分>[,<部分>[,...]]]
    该选项使 Swaks 打印选项处理的结果,
    就在邮件发送之前。不会发送任何邮件
    当使用“--dump”时。注意“--dump”是纯粹的自我诊断
    工具,并且不会或永远不会努力掩盖密码
    “--dump”输出。如果提供一个部分作为这个的参数
    选项,只会显示请求的部分。现在
    支持的参数是 SUPPORT, APP, OUTPUT, TRANSPORT, PROTOCOL,
    XCLIENT、PROXY、TLS、AUTH、DATA 和 ALL。如果没有参数
    提供,显示所有部分(Arg-可选)

- 帮助
    显示此帮助信息并退出。(Arg-无)

- 版本
    显示版本信息并退出。(Arg-无)

Deprecation
The following features are deprecated and will be removed in future
swax releases

-g 选项
    最迟将于 2021 年 11 月 1 日移除。

    -g 选项目前是“--data -”的不太好的别名。任何用途
    “-g”的应该可以直接迁移到“--data -”
    反而。

自动文件名检测
    最迟将于 2021 年 11 月 1 日移除。

    “--data”、“--body”、“--attach”和“--attach-body”选项
    目前将尝试区分一个论点是
    使用的实际值与代表文件的参数
    包含要使用的数据。此行为已被取代
    用“@”为这些选项的参数添加前缀以显式
    表明该参数表示一个文件。提供的任何用途
    这些选项之一的文件名应该移动到使用“@”来
    表示正在使用文件名。

Portability
Operating Systems
This program is primarily intended for use on UNIX-like operating
systems, and it should work on any reasonable version. It
has been developed and tested on Solaris, Linux, and Mac OS X, and is
fully functional on all of them.

    该程序以演示 Windows 上的基本功能而著称
    使用 ActiveState 的 Perl。它尚未经过全面测试。众所周知
    work 是基本的 SMTP 功能和 LOGIN、PLAIN 和 CRAM-MD5
    授权类型。未知的是任何 TLS 功能和 NTLM/SPA 和
    DIGEST-MD5 授权类型。

    因为这个程序应该在任何 Perl 工作的地方工作,我会
    感谢您彻底了解任何新操作系统
    使用 Swaks 以及在新操作系统上遇到的任何问题。

邮件服务器
    该程序几乎专门针对 Exim 邮件开发
    服务器。被作者随便用过,虽然不是
    通过 Sendmail、Smail、Exchange、Oracle 进行了全面测试
    协作套件、qpsmtpd 和 Communigate。因为所有
    Swaks 中的功能基于它应该工作的已知标准
    使用任何相当现代的邮件服务器。如果发现问题,请
    通过以下地址提醒作者。

ENVIRONMENT
VARIABLES LOGNAME
If Swaks has to create the sender address, $LOGNAME is used
if the message-local part is set, unless "--force-getpwuid" is
used.

SWAKS_家
    在搜索 .swaksrc 配置文件时使用。见选项
    处理 -> 上面的“配置文件”。

SWAKS_OPT_*
    用于指定 Swaks 选项的环境变量前缀
    环境变量。请参阅选项处理 -> “配置
    环境变量”上面。

Exit code
0 No error occurred

1 错误解析命令行选项

2 错误连接到远程服务器

3 未知连接类型

4 以“管道”连接类型运行时,写入致命问题
    到子进程或从子进程读取

5 以“管道”连接类型运行时,子进程终止
    不料。这可能意味着用“--pipe”指定的程序
    不存在。

6 连接意外关闭。如果响应检测到关闭
    Swaks 在意外响应后向“QUIT”发送消息,
    而是使用该意外响应的错误代码。为了
    例如,如果邮件服务器对 MAIL FROM 返回 550 响应:
    然后立即关闭连接,Swaks 检测到
    连接已关闭,但使用更具体的退出代码 23 来
    详细说明故障的性质。相反,如果服务器返回 250
    代码然后立即关闭连接,Swaks 将使用
    退出代码 6,因为没有更具体的退出代码。

10 先决条件错误(所需模块不可用)

21 从服务器读取初始横幅时出错

HELO 事务中的 22 错误

23 邮件交易错误

24 没有接受 RCPT

25 服务器向 DATA 请求返回错误

26 服务器不接受邮件以下数据

27 服务器在正常会话退出请求后返回错误

AUTH 事务中的 28 错误

TLS 事务中的 29 错误

30 PRDR 请求/要求但未公布

TLS 协商后 EHLO 出现 32 错误

XCLIENT 事务中的 33 错误

XCLIENT 之后的 EHLO 中出现 34 错误

PROXY 选项处理中的 35 错误

36 发送 PROXY 横幅时出错

4. Source content

1. Original address

2. Source content

NAME
    Swaks - Swiss Army Knife SMTP, the all-purpose SMTP transaction tester

DESCRIPTION
    Swaks' primary design goal is to be a flexible, scriptable,
    transaction-oriented SMTP test tool. It handles SMTP features and
    extensions such as TLS, authentication, and pipelining; multiple version
    of the SMTP protocol including SMTP, ESMTP, and LMTP; and multiple
    transport methods including UNIX-domain sockets, internet-domain
    sockets, and pipes to spawned processes. Options can be specified in
    environment variables, configuration files, and the command line
    allowing maximum configurability and ease of use for operators and
    scripters.

QUICK START
    Deliver a standard test email to [email protected] on port 25 of
    test-server.example.net:

         swaks --to [email protected] --server test-server.example.net

    Deliver a standard test email, requiring CRAM-MD5 authentication as user
    [email protected]. An "X-Test" header will be added to the email body. The
    authentication password will be prompted for if it cannot be obtained
    from your .netrc file.

         swaks --to [email protected] --from [email protected] --auth CRAM-MD5 --auth-user [email protected] --header-X-Test "test email"

    Test a virus scanner using EICAR in an attachment. Don't show the
    message DATA part.:

         swaks -t [email protected] --attach - --server test-server.example.com --suppress-data </path/to/eicar.txt

    Test a spam scanner using GTUBE in the body of an email, routed via the
    MX records for example.com:

         swaks --to [email protected] --body /path/to/gtube/file

    Deliver a standard test email to [email protected] using the LMTP
    protocol via a UNIX domain socket file

         swaks --to [email protected] --socket /var/lda.sock --protocol LMTP

    Report all the recipients in a text file that are non-verifiable on a
    test server:

         for E in `cat /path/to/email/file`
         do
             swaks --to $E --server test-server.example.com --quit-after RCPT --hide-all
             [ $? -ne 0 ] && echo $E
         done

TERMS AND CONVENTIONS
    This document tries to be consistent and specific in its use of the
    following terms to reduce confusion.

    Target
        The target of a transaction is the thing that Swaks connects to.
        This generic term is used throughout the documentation because most
        other terms improperly imply something about the transport being
        used.

    Transport
        The transport is the underlying method used to connect to the
        target.

    Transaction
        A transaction is the opening of a connection over a transport to a
        target and using a messaging protocol to attempt to deliver a
        message.

    Protocol
        The protocol is the application language used to communicate with
        the target. This document uses SMTP to speak generically of all
        three supported protocols unless it states that it is speaking of
        the specific 'SMTP' protocol and excluding the others.

    Message
        SMTP protocols exist to transfer messages, a set of bytes in an
        agreed-upon format that has a sender and a recipient.

    Envelope
        A message's envelope contains the "true" sender and receiver of a
        message. It can also be referred to as its components,
        envelope-sender and envelope-recipients. It is important to note
        that a messages envelope does not have to match its "To:" and
        "From:" headers.

    DATA
        The DATA portion of an SMTP transaction is the actual message that
        is being transported. It consists of both the message's headers and
        its body. DATA and body are sometimes used synonymously, but they
        are always two distinct things in this document.

    Headers
        A message's headers are defined as all the lines in the message's
        DATA section before the first blank line. They contain information
        about the email that will be displayed to the recipient such as
        "To:", "From:", "Subject:", etc. In this document headers will
        always be written with a capitalized first letter and a trailing
        colon.

    Body
        A message's body is the portion of its DATA section following the
        first blank line.

    Option
        An option is a flag which changes Swaks' behavior. Always called an
        option regardless of how it is provided. For instance,
        "--no-data-fixup" is an option.

    Argument
        When an option takes addition data beside the option itself, that
        additional data is called an argument. In "--quit-after
        <stop-point>'", "<stop-point>" is the argument to the "--quit-after"
        option.

    <literal-string>
        When used in the definition of an option, text that is inside of
        angle brackets ("<>") indicates a descriptive label for a value that
        the user should provide. For instance, "--quit-after <stop-point>"
        indicates that "<stop-point>" should be replaced with a valid
        stop-point value.

    [<optional-value>]
        When used in the definition of an option, text inside of square
        brackets ([]) indicates that the value is optional and can be
        omitted. For instance, "--to [<recipient>]" indicates that the
        "--to" option can be used with or without a specified "<recipient>".

OPTION PROCESSING
    To prevent potential confusion in this document a flag to Swaks is
    always referred to as an "option". If the option takes additional data,
    that additional data is referred to as an argument to the option. For
    example, "--from [email protected]" might be provided to Swaks on the
    command line, with "--from" being the option and "[email protected]"
    being "--from"'s argument.

    Options and arguments are the only way to provide information to Swaks.
    If Swaks finds data during option processing that is neither an option
    nor an option's argument, it will error and exit. For instance, if
    "--no-data-fixup 1" were found on the command line, this would result in
    an error because "--no-data-fixup" does not take an argument and
    therefore Swaks would not know what to do with 1.

    Options can be given to Swaks in three ways. They can be specified in a
    configuration file, in environment variables, and on the command line.
    Depending on the specific option and whether an argument is given to it,
    Swaks may prompt the user for the argument.

    When Swaks evaluates its options, it first looks for a configuration
    file (either in a default location or specified with "--config"). Then
    it evaluates any options in environment variables. Finally, it evaluates
    command line options. At each round of processing, any options set
    earlier will be overridden. Additionally, any option can be prefixed
    with "no-" to cause Swaks to forget that the variable had previously
    been set (either in an earlier round, or earlier in the same round).
    This capability is necessary because many options treat
    defined-but-no-argument differently than not-defined.

    As a general rule, if the same option is given multiple time, the last
    time it is given is the one that will be used. This applies to both
    intra-method (if "--from [email protected] --from [email protected]" is
    given, "[email protected]" will be used) and inter-method (if "from
    [email protected]" is given in a config file and "--from
    [email protected]" is given on the command line, "[email protected]"
    will be used)

    Each option definition ends with a parenthetical synopsis of how the
    option behaves. The following codes can be used

    Arg-None, Arg-Optional, Arg-Required
        These three codes are mutually exclusive and describe whether or not
        the option takes an argument. Note that this does not necessarily
        describe whether the argument is required to be specified directly,
        but rather whether an argument is required eventually. For instance,
        "--to" is labeled as Arg-Required, but it is legal to specify "--to"
        on the command line without an argument. This is because Swaks can
        prompt for the required argument if it is not directly provided.

    From-Prompt
        An option labeled with From-Prompt will prompt the user
        interactively for the argument if none is provided.

    From-File
        An option labeled with From-File will handle arguments as files in
        certain situations.

        If the initial argument is "-", the final argument is the contents
        of "STDIN". Multiple options can all specify "STDIN", but the same
        content will be used for each of them.

        If the initial argument is prefixed with "@", the argument will be
        treated as a path to a file. The file will be opened and the
        contents will be used as the final argument. If the contents of the
        file can't be read, Swaks will exit. To specify a literal value
        starting with an "@", use two "@" symbols. The first will be
        stripped.

    Sensitive
        If an option marked Sensitive attempts to prompt the user for an
        argument and the "--protect-prompt" option is set, Swaks will
        attempt to mask the user input from being echoed on the terminal.
        Swaks tries to mask the input in several ways, but if none of them
        work program flow will continue with unmasked input.

    Deprecated
        An option labeled Deprecated has been officially deprecated and will
        be removed in a future release. See the "DEPRECATIONS" section of
        this documentation for details about the deprecations.

    The exact mechanism and format for using each of the types is listed
    below.

    CONFIGURATION FILES
        A configuration file can be used to set commonly-used or abnormally
        verbose options. By default, Swaks looks in order for
        $SWAKS_HOME/.swaksrc, $HOME/.swaksrc, and $LOGDIR/.swaksrc. If one
        of those is found to exist (and "--config" has not been used) that
        file is used as the configuration file.

        Additionally, a configuration file in a non-default location can be
        specified using "--config". If this is set and not given an argument
        Swaks will not use any configuration file, including any default
        file. If "--config" points to a readable file, it is used as the
        configuration file, overriding any default that may exist. If it
        points to a non-readable file an error will be shown and Swaks will
        exit.

        A set of "portable" defaults can also be created by adding options
        to the end of the Swaks program file. As distributed, the last line
        of Swaks should be "__END__". Any lines added after "__END__" will
        be treated as the contents of a configuration file. This allows a
        set of user preferences to be automatically copied from server to
        server in a single file.

        If configuration files have not been explicitly turned off, the
        "__END__" config is always read. Only one other configuration file
        will ever be used per single invocation of Swaks, even if multiple
        configuration files are specified. If the "__END__" config and
        another config are to be read, the "__END__" config will be
        processed first. Specifying the "--config" option with no argument
        turns off the processing of both the "__END__" config and any actual
        config files.

        In a configuration file lines beginning with a hash ("#") are
        ignored. All other lines are assumed to be an option to Swaks, with
        the leading dash or dashes optional. Everything after an option
        line's first space is assumed to be the option's argument and is not
        shell processed. Therefore, quoting is usually unneeded and will be
        included literally in the argument.

        There is a subtle difference between providing an option with no
        argument and providing an option with an empty argument. If an
        option line does not have a space, the entire line is treated as an
        option and there is no argument. If the line ends in a single space,
        it will be processed as an option with an empty argument. So, "apt"
        will be treated as "--apt", but "apt " will be treated as
        "--apt ''".

        Here is an example of the contents of a configuration file:

            # always use this sender, no matter server or logged in user
            --from [email protected]
            # I prefer my test emails have a pretty from header.  Note
            # the lack of dashes on option and lack of quotes around
            # entire argument.
            h-From: "Fred Example" <[email protected]>

        Options specific to configuration file:

        --config [<config-file>]
            This option provides a path to a specific configuration file to
            be used. If specified with no argument, no automatically-found
            configuration file (via $HOME, etc, or "__END__") will be
            processed. If the argument is a valid file, that file will be
            used as the configuration file (after "__END__" config). If
            argument is not a valid, readable file, Swaks will error and
            exit. This option can be specified multiple times, but only the
            first time it is specified (in environment variable and the
            command line search order) will be used. (Arg-Optional)

    CONFIGURATION ENVIRONMENT VARIABLES
        Options can be supplied via environment variables. The variables are
        in the form $SWAKS_OPT_name, where "name" is the name of the option
        that would be specified on the command line. Because dashes aren't
        allowed in environment variable names in most UNIX-ish shells, no
        leading dashes should be used and any dashes inside the option's
        name should be replaced with underscores. The following would create
        the same options shown in the configuration file example:

            $ SWAKS_OPT_from='[email protected]'
            $ SWAKS_OPT_h_From='"Fred Example" <[email protected]>'

        Setting a variable to an empty value is the same as specifying it on
        the command line with no argument. For instance, setting
        <SWAKS_OPT_server=""> would cause Swaks to prompt the user for the
        server to which to connect at each invocation.

        Because there is no inherent order in options provided by setting
        environment variables, the options are sorted before being
        processed. This is not a great solution, but it at least defines the
        behavior, which would be otherwise undefined. As an example, if both
        $SWAKS_OPT_from and $SWAKS_OPT_f were set, the value from
        $SWAKS_OPT_from would be used, because it sorts after $SWAKS_OPT_f.
        Also as a result of not having an inherent order in environment
        processing, unsetting options with the "no-" prefix is unreliable.
        It works if the option being turned off sorts before "no-", but
        fails if it sorts after. Because "no-" is primarily meant to operate
        between config types (for instance, unsetting from the command line
        an option that was set in a config file), this is not likely to be a
        problem.

        In addition to setting the equivalent of command line options,
        $SWAKS_HOME can be set to a directory containing the default
        .swaksrc to be used.

    COMMAND LINE OPTIONS
        The final method of supplying options to Swaks is via the command
        line. The options behave in a manner consistent with most UNIX-ish
        command line programs. Many options have both a short and long form
        (for instance "-s" and "--server"). By convention short options are
        specified with a single dash and long options are specified with a
        double-dash. This is only a convention and either prefix will work
        with either type.

        The following demonstrates the example shown in the configuration
        file and environment variable sections:

            $ swaks --from [email protected] --h-From: '"Fred Example" <[email protected]>'

TRANSPORTS
    Swaks can connect to a target via UNIX pipes ("pipes"), UNIX domain
    sockets ("UNIX sockets"), or internet domain sockets ("network
    sockets"). Connecting via network sockets is the default behavior.
    Because of the singular nature of the transport used, each set of
    options in the following section is mutually exclusive. Specifying more
    than one of "--server", "--pipe", or "--socket" will result in an error.
    Mixing other options between transport types will only result in the
    irrelevant options being ignored. Below is a brief description of each
    type of transport and the options that are specific to that transport
    type.

    NETWORK SOCKETS
        This transport attempts to deliver a message via TCP/IP, the
        standard method for delivering SMTP. This is the default transport
        for Swaks. If none of "--server", "--pipe", or "--socket" are given
        then this transport is used and the target server is determined from
        the recipient's domain (see "--server" below for more details).

        This transport requires the IO::Socket module which is part of the
        standard Perl distribution. If this module is not loadable,
        attempting to use this transport will result in an error and program
        termination.

        IPv6 is supported when the IO::Socket::INET6 module is present.

        -s, --server [<target-server>[:<port>]]
            Explicitly tell Swaks to use network sockets and specify the
            hostname or IP address to which to connect, or prompt if no
            argument is given. If this option is not given and no other
            transport option is given, the target mail server is determined
            from the appropriate DNS records for the domain of the recipient
            email address using the Net::DNS module. If Net::DNS is not
            available Swaks will attempt to connect to localhost to deliver.
            The target port can optionally be set here. Supported formats
            for this include SERVER:PORT (supporting names and IPv4
            addresses); [SERVER]:PORT and SERVER/PORT (supporting names,
            IPv4 and IPv6 addresses). See also "--copy-routing".
            (Arg-Required, From-Prompt)

        -p, --port [<port>]
            Specify which TCP port on the target is to be used, or prompt if
            no argument is listed. The argument can be a service name (as
            retrieved by getservbyname(3)) or a port number. The default
            port is smtp/25 unless influenced by the "--protocol" or
            "--tls-on-connect" options. (Arg-Required, From-Prompt)

        -li, --local-interface [<local-interface>[:<port>]]
            Use argument as the local interface for the outgoing SMTP
            connection, or prompt user if no argument given. Argument can be
            an IP address or a hostname. Default action is to let the
            operating system choose the local interface. See "--server" for
            additional comments on :<port> format. (Arg-Required,
            From-Prompt)

        -lp, --local-port, --lport [<port>]
            Specify the outgoing port from which to originate the
            transaction. The argument can be a service name (as retrieved by
            getservbyname(3)) or a port number. If this option is not
            specified the system will pick an ephemeral port. Note that
            regular users cannot specify some ports. (Arg-Required,
            From-Prompt)

        --copy-routing <domain>
            The argument is interpreted as the domain part of an email
            address and it is used to find the target server using the same
            logic that would be used to look up the target server for a
            recipient email address. See "--to" option for more details on
            how the target is determined from the email domain.
            (Arg-Required)

        -4, -6
            Force IPv4 or IPv6. (Arg-None)

    UNIX SOCKETS
        This transport method attempts to deliver messages via a UNIX-domain
        socket file. This is useful for testing MTA/MDAs that listen on
        socket files (for instance, testing LMTP delivery to Cyrus). This
        transport requires the IO::Socket module which is part of the
        standard Perl distribution. If this module is not loadable,
        attempting to use this transport will result in an error and program
        termination.

        --socket [<socket-file>]
            This option takes as its argument a UNIX-domain socket file. If
            Swaks is unable to open this socket it will display an error and
            exit. (Arg-Required, From-Prompt)

    PIPES
        This transport attempts to spawn a process and communicate with it
        via pipes. The spawned program must be prepared to behave as a mail
        server over "STDIN"/"STDOUT". Any MTA designed to operate from
        inet/xinet should support this. In addition, some MTAs provide
        testing modes that can be communicated with via "STDIN"/"STDOUT".
        This transport can be used to automate that testing. For example, if
        you implemented DNSBL checking with Exim and you wanted to make sure
        it was working, you could run "swaks --pipe "exim -bh 127.0.0.2"".
        Ideally, the process you are talking to should behave exactly like
        an SMTP server on "STDIN" and "STDOUT". Any debugging should be sent
        to "STDERR", which will be directed to your terminal. In practice,
        Swaks can generally handle some debug on the child's "STDOUT", but
        there are no guarantees on how much it can handle.

        This transport requires the IPC::Open2 module which is part of the
        standard Perl distribution. If this module is not loadable,
        attempting to use this transport will result in an error and program
        termination.

        --pipe [<command-and-arguments>]
            Provide a process name and arguments to the process. Swaks will
            attempt to spawn the process and communicate with it via pipes.
            If the argument is not an executable Swaks will display an error
            and exit. (Arg-Required, From-Prompt)

PROTOCOL OPTIONS
    These options are related to the protocol layer.

    -t, --to [<email-address>[,<email-address>[,...]]]
        Tells Swaks to use argument(s) as the envelope-recipient for the
        email, or prompt for recipient if no argument provided. If multiple
        recipients are provided and the recipient domain is needed to
        determine routing the domain of the last recipient provided is used.

        There is no default value for this option. If no recipients are
        provided via any means, user will be prompted to provide one
        interactively. The only exception to this is if a "--quit-after"
        value is provided which will cause the SMTP transaction to be
        terminated before the recipient is needed. (Arg-Required,
        From-Prompt)

    -f, --from [<email-address>]
        Use argument as envelope-sender for email, or prompt user if no
        argument specified. The string "<>" can be supplied to mean the null
        sender. If user does not specify a sender address a default value is
        used. The domain-part of the default sender is a best guess at the
        fully-qualified domain name of the local host. The method of
        determining the local-part varies. On Windows, "Win32::LoginName()"
        is used. On UNIX-ish platforms, the $LOGNAME environment variable is
        used if it is set. Otherwise getpwuid(3) is used. See also
        "--force-getpwuid". If Swaks cannot determine a local hostname and
        the sender address is needed for the transaction, Swaks will error
        and exit. In this case, a valid string must be provided via this
        option. (Arg-Required, From-Prompt)

    --ehlo, --lhlo, -h, --helo [<helo-string>]
        String to use as argument to HELO/EHLO/LHLO command, or prompt user
        if no argument is specified. If this option is not used a best guess
        at the fully-qualified domain name of the local host is used. If
        Swaks cannot determine a local hostname and the helo string is
        needed for the transaction, Swaks will error and exit. In this case,
        a valid string must be provided via this option. (Arg-Required,
        From-Prompt)

    -q, --quit, --quit-after <stop-point>
        Point at which the transaction should be stopped. When the requested
        stopping point is reached in the transaction, and provided that
        Swaks has not errored out prior to reaching it, Swaks will send
        "QUIT" and attempt to close the connection cleanly. These are the
        valid arguments and notes about their meaning. (Arg-Required)

        CONNECT, BANNER
            Terminate the session after receiving the greeting banner from
            the target.

        FIRST-HELO, FIRST-EHLO, FIRST-LHLO
            In a STARTTLS (but not tls-on-connect) session, terminate the
            transaction after the first of two HELOs. In a non-STARTTLS
            transaction, behaves the same as HELO (see below).

        XCLIENT
            Quit after XCLIENT is sent.

        STARTTLS, TLS
            Quit the transaction immediately following TLS negotiation. Note
            that this happens in different places depending on whether
            STARTTLS or tls-on-connect are used. This always quits after the
            point where TLS would have been negotiated, regardless of
            whether it was attempted.

        HELO, EHLO, LHLO
            In a STARTTLS or XCLIENT session, quit after the second HELO.
            Otherwise quit after the first and only HELO.

        AUTH
            Quit after authentication. This always quits after the point
            where authentication would have been negotiated, regardless of
            whether it was attempted.

        MAIL, FROM
            Quit after MAIL FROM: is sent.

        RCPT, TO
            Quit after RCPT TO: is sent.

    --da, --drop-after <stop-point>
        The option is similar to "--quit-after", but instead of trying to
        cleanly shut down the session it simply terminates the session. This
        option accepts the same stop-points as "--quit-after" and
        additionally accepts DATA and DOT, detailed below. (Arg-Required)

        DATA
            Quit after DATA is sent.

        DOT Quit after the final '.' of the message is sent.

    --das, --drop-after-send <stop-point>
        This option is similar to "--drop-after", but instead of dropping
        the connection after reading a response to the stop-point, it drops
        the connection immediately after sending stop-point. It accepts the
        same stop-points as "--drop-after". (Arg-Required)

    --timeout [<time>]
        Use argument as the SMTP transaction timeout, or prompt user if no
        argument given. Argument can either be a pure digit, which will be
        interpreted as seconds, or can have a specifier s, m, or h (5s = 5
        seconds, 3m = 180 seconds, 1h = 3600 seconds). As a special case, 0
        means don't timeout the transactions. Default value is 30s.
        (Arg-Required, From-Prompt)

    --protocol <protocol>
        Specify which protocol to use in the transaction. Valid options are
        shown in the table below. Currently the 'core' protocols are SMTP,
        ESMTP, and LMTP. By using variations of these protocol types one can
        tersely specify default ports, whether authentication should be
        attempted, and the type of TLS connection that should be attempted.
        The default protocol is ESMTP. The following table demonstrates the
        available arguments to "--protocol" and the options each sets as a
        side effect. (Arg-Required)

        SMTP
            HELO, "-p 25"

        SSMTP
            EHLO->HELO, "-tlsc -p 465"

        SSMTPA
            EHLO->HELO, "-a -tlsc -p 465"

        SMTPS
            HELO, "-tlsc -p 465"

        ESMTP
            EHLO->HELO, "-p 25"

        ESMTPA
            EHLO->HELO, "-a -p 25"

        ESMTPS
            EHLO->HELO, "-tls -p 25"

        ESMTPSA
            EHLO->HELO, "-a -tls -p 25"

        LMTP
            LHLO, "-p 24"

        LMTPA
            LHLO, "-a -p 24"

        LMTPS
            LHLO, "-tls -p 24"

        LMTPSA
            LHLO, "-a -tls -p 24"

    --pipeline
        If the remote server supports it, attempt SMTP PIPELINING (RFC
        2920). (Arg-None)

    --prdr
        If the server supports it, attempt Per-Recipient Data Response
        (PRDR) (<https://tools.ietf.org/html/draft-hall-prdr-00.txt>). PRDR
        is not yet standardized, but MTAs have begun implementing the
        proposal. (Arg-None)

    --force-getpwuid
        Tell Swaks to use the getpwuid method of finding the default sender
        local-part instead of trying $LOGNAME first. (Arg-None)

TLS / ENCRYPTION
    These are options related to encrypting the transaction. These have been
    tested and confirmed to work with all three transport methods. The
    Net::SSLeay module is used to perform encryption when it is requested.
    If this module is not loadable Swaks will either ignore the TLS request
    or error out, depending on whether the request was optional. STARTTLS is
    defined as an extension in the ESMTP protocol and will be unavailable if
    "--protocol" is set to a variation of SMTP. Because it is not defined in
    the protocol itself, "--tls-on-connect" is available for any protocol
    type if the target supports it.

    A local certificate is not required for a TLS connection to be
    negotiated. However, some servers use client certificate checking to
    verify that the client is allowed to connect. Swaks can be told to use a
    specific local certificate using the "--tls-cert" and "--tls-key"
    options.

    -tls
        Require connection to use STARTTLS. Exit if TLS not available for
        any reason (not advertised, negotiations failed, etc). (Arg-None)

    -tlso, --tls-optional
        Attempt to use STARTTLS if available, continue with normal
        transaction if TLS was unable to be negotiated for any reason. Note
        that this is a semi-useless option as currently implemented because
        after a negotiation failure the state of the connection is unknown.
        In some cases, like a version mismatch, the connection should be
        left as plaintext. In others, like a verification failure, the
        server-side may think that it should continue speaking TLS while the
        client thinks it is plaintext. There may be an attempt to add more
        granular state detection in the future, but for now just be aware
        that odd things may happen with this option if the TLS negotiation
        is attempted and fails. (Arg-None)

    -tlsos, --tls-optional-strict
        Attempt to use STARTTLS if available. Proceed with transaction if
        TLS is negotiated successfully or STARTTLS not advertised. If
        STARTTLS is advertised but TLS negotiations fail, treat as an error
        and abort transaction. Due to the caveat noted above, this is a much
        saner option than "--tls-optional". (Arg-None)

    -tlsc, --tls-on-connect
        Initiate a TLS connection immediately on connection. Following
        common convention, if this option is specified the default port
        changes from 25 to 465, though this can still be overridden with the
        --port option. (Arg-None)

    -tlsp, --tls-protocol <tls-version-specification>
        Specify which protocols to use (or not use) when negotiating TLS. At
        the time of this writing, the available protocols are sslv2, sslv3,
        tlsv1, tlsv1_1, tlsv1_2, and tlsv1_3. The availability of these
        protocols is dependent on your underlying OpenSSL library, so not
        all of these may be available. The list of available protocols is
        shown in the output of "--dump" (assuming TLS is available at all).

        The specification string is a comma-delimited list of protocols that
        can be used or not used. For instance 'tlsv1,tlsv1_1' will only
        succeed if one of those two protocols is available on both the
        client and the server. Conversely, 'no_sslv2,no_sslv3' will attempt
        to negotiate any protocol except sslv2 and sslv3. The two forms of
        specification cannot be mixed. (Arg-Required)

    --tls-cipher <cipher-string>
        The argument to this option is passed to the underlying OpenSSL
        library to set the list of acceptable ciphers to the be used for the
        connection. The format of this string is opaque to Swaks and is
        defined in
        <http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT>.
        A brief example would be "--tls-cipher '3DES:+RSA'". (Arg-Required)

    --tls-verify
        Tell Swaks to attempt to verify the server's certificate. If this
        option is set and the server's certificate is not verifiable (either
        using the system-default CA information, or custom CA information
        (see "--tls-ca-path")) TLS negotiation will not succeed. By default,
        Swaks does not attempt certificate verification. (Arg-None)

    --tls-ca-path <ca-location>
        Specify an alternate location for CA information for verifying
        server certificates. The argument can point to a file or directory.
        The default behavior is to use the underlying OpenSSL library's
        default information. (Arg-Required)

    --tls-cert <cert-file>
        Provide a path to a file containing the local certificate Swaks
        should use if TLS is negotiated. The file path argument is required.
        As currently implemented the certificate in the file must be in PEM
        format. Contact the author if there's a compelling need for ASN1. If
        this option is set, "--tls-key" is also required. (Arg-Required)

    --tls-key <key-file>
        Provide a path to a file containing the local private key Swaks
        should use if TLS is negotiated. The file path argument is required.
        As currently implemented the certificate in the file must be in PEM
        format. Contact the author if there's a compelling need for ASN1. If
        this option is set, "--tls-cert" is also required. (Arg-Required)

    --tls-get-peer-cert [<output-file>]
        Get a copy of the TLS peer's certificate. If no argument is given,
        it will be displayed to "STDOUT". If an argument is given it is
        assumed to be a filesystem path specifying where the certificate
        should be written. The saved certificate can then be examined using
        standard tools such as the openssl command. If a file is specified
        its contents will be overwritten. (Arg-Optional)

    --tls-sni <sni-string>
        Specify the Server Name Indication field to send when the TLS
        connection is initiated. (Arg-Required)

AUTHENTICATION
    Swaks will attempt to authenticate to the target mail server if
    instructed to do so. This section details available authentication
    types, requirements, options and their interactions, and other fine
    points in authentication usage. Because authentication is defined as an
    extension in the ESMTP protocol it will be unavailable if "--protocol"
    is set to a variation of SMTP.

    All authentication methods require base64 encoding. If the MIME::Base64
    Perl module is loadable Swaks attempts to use it to perform these
    encodings. If MIME::Base64 is not available Swaks will use its own
    onboard base64 routines. These are slower than the MIME::Base64 routines
    and less reviewed, though they have been tested thoroughly. Using the
    MIME::Base64 module is encouraged.

    If authentication is required (see options below for when it is and
    isn't required) and the requirements aren't met for the authentication
    type available, Swaks displays an error and exits. Two ways this can
    happen include forcing Swaks to use a specific authentication type that
    Swaks can't use due to missing requirements, or allowing Swaks to use
    any authentication type, but the server only advertises types Swaks
    can't support. In the former case Swaks errors out at option processing
    time since it knows up front it won't be able to authenticate. In the
    latter case Swaks will error out at the authentication stage of the SMTP
    transaction since Swaks will not be aware that it will not be able to
    authenticate until that point.

    Following are the supported authentication types including any
    individual notes and requirements.

    The following options affect Swaks' use of authentication. These options
    are all inter-related. For instance, specifying "--auth-user" implies
    "--auth" and "--auth-password". Specifying "--auth-optional" implies
    "--auth-user" and "--auth-password", etc.

    -a, --auth [<auth-type>[,<auth-type>[,...]]]
        Require Swaks to authenticate. If no argument is given, any
        supported auth-types advertised by the server are tried until one
        succeeds or all fail. If one or more auth-types are specified as an
        argument, each that the server also supports is tried in order until
        one succeeds or all fail. This option requires Swaks to
        authenticate, so if no common auth-types are found or no credentials
        succeed, Swaks displays an error and exits. (Arg-Optional)

        The following tables lists the valid auth-types

        LOGIN, PLAIN
            These basic authentication types are fully supported and tested
            and have no additional requirements

        CRAM-MD5
            The CRAM-MD5 authenticator requires the Digest::MD5 module. It
            is fully tested and believed to work against any server that
            implements it.

        DIGEST-MD5
            The DIGEST-MD5 authenticator (RFC2831) requires the Authen::SASL
            module. Version 20100211.0 and earlier used Authen::DigestMD5
            which had some protocol level errors which prevented it from
            working with some servers. Authen::SASL's DIGEST-MD5 handling is
            much more robust.

            The DIGEST-MD5 implementation in Swaks is fairly immature. It
            currently supports only the "auth" qop type, for instance. If
            you have DIGEST-MD5 experience and would like to help Swaks
            support DIGEST-MD5 better, please get in touch with me.

            The DIGEST-MD5 protocol's "realm" value can be set using the
            "--auth-extra" "realm" keyword. If no realm is given, a
            reasonable default will be used.

            The DIGEST-MD5 protocol's "digest-uri" values can be set using
            the "--auth-extra" option. For instance, you could create the
            digest-uri-value of "lmtp/mail.example.com/example.com" with the
            option "--auth-extra
            dmd5-serv-type=lmtp,dmd5-host=mail.example.com,dmd5-serv-name=ex
            ample.com". The "digest-uri-value" string and its components is
            defined in RFC2831. If none of these values are given,
            reasonable defaults will be used.

        CRAM-SHA1
            The CRAM-SHA1 authenticator requires the Digest::SHA module.
            This type has only been tested against a non-standard
            implementation on an Exim server and may therefore have some
            implementation deficiencies.

        NTLM/SPA/MSN
            These authenticators require the Authen::NTLM module. Note that
            there are two modules using the Authen::NTLM namespace on CPAN.
            The Mark Bush implementation (Authen/NTLM-1.03.tar.gz) is the
            version required by Swaks. This type has been tested against
            Exim, Communigate, and Exchange 2007.

            In addition to the standard username and password, this
            authentication type can also recognize a "domain". The domain
            can be set using the "--auth-extra" "domain" keyword. Note that
            this has never been tested with a mail server that doesn't
            ignore DOMAIN so this may be implemented incorrectly.

    -ao, --auth-optional [<auth-type>[,<auth-type>[,...]]]
        This option behaves identically to "--auth" except that it requests
        authentication rather than requiring it. If no common auth-types are
        found or no credentials succeed, Swaks proceeds as if authentication
        had not been requested. (Arg-Optional)

    -aos, --auth-optional-strict [<auth-type>[,<auth-type>[,...]]]
        This option is a compromise between "--auth" and "--auth-optional".
        If no common auth-types are found, Swaks behaves as if
        "--auth-optional" were specified and proceeds with the transaction.
        If Swaks can't support requested auth-type, the server doesn't
        advertise any common auth-types, or if no credentials succeed, Swaks
        behaves as if "--auth" were used and exits with an error.
        (Arg-Optional)

    -au, --auth-user [<username>]
        Provide the username to be used for authentication. If no username
        is provided, indicate that Swaks should attempt to find the username
        via .netrc (requires the Net::Netrc module). If no username is
        provided and cannot be found via .netrc, the user will be prompted
        to provide one. The string "<>" can be supplied to mean an empty
        username. (Arg-Required, From-Prompt)

    -ap, --auth-password [<password>]
        Provide the password to be used for authentication. If no password
        is provided, indicate that Swaks should attempt to find the password
        via .netrc (requires the Net::Netrc module). If no password is
        provided and cannot be found via .netrc, the user will be prompted
        to provide one. The string "<>" can be supplied to mean an empty
        password. (Arg-Required, From-Prompt, Sensitive)

    -ae, --auth-extra <key-value-pair>[,<key-value-pair>[,...]]
        Some of the authentication types allow extra information to be
        included in the authentication process. Rather than add a new option
        for every nook and cranny of each authenticator, the "--auth-extra"
        option allows this information to be supplied. The format for
        <key-value-pair> is KEYWORD=VALUE. (Arg-Required)

        The following table lists the currently recognized keywords and the
        authenticators that use them

        realm, domain
            The realm and domain keywords are synonymous. Using either will
            set the "domain" option in NTLM/MSN/SPA and the "realm" option
            in DIGEST-MD5

        dmd5-serv-type
            The dmd5-serv-type keyword is used by the DIGEST-MD5
            authenticator and is used, in part, to build the
            digest-uri-value string (see RFC2831)

        dmd5-host
            The dmd5-host keyword is used by the DIGEST-MD5 authenticator
            and is used, in part, to build the digest-uri-value string (see
            RFC2831)

        dmd5-serv-name
            The dmd5-serv-name keyword is used by the DIGEST-MD5
            authenticator and is used, in part, to build the
            digest-uri-value string (see RFC2831)

    -am, --auth-map <key-value-pair>[,<key-value-pair>[,...]]
        Provides a way to map alternate names onto base authentication
        types. Useful for any sites that use alternate names for common
        types. The format for <key-value-pair> is AUTH-ALIAS=AUTH-TYPE. This
        functionality is actually used internally to map types SPA and MSN
        onto the base type NTLM. The command line argument to simulate this
        would be "--auth-map SPA=NTLM,MSN=NTLM". All of the auth-types
        listed above are valid targets for mapping except SPA and MSN.
        (Arg-Required)

    -apt, --auth-plaintext
        Instead of showing AUTH strings base64 encoded as they are
        transmitted, translate them to plaintext before printing on screen.
        (Arg-None)

    -ahp, --auth-hide-password [<replacement-string>]
        If this option is specified, any time a readable password would be
        printed to the terminal (specifically AUTH PLAIN and AUTH LOGIN) the
        password is replaced with the string 'PROVIDED_BUT_REMOVED' (or the
        contents of <replacement-string> if provided). The dummy string may
        or may not be base64 encoded, contingent on the "--auth-plaintext"
        option.

        Note that "--auth-hide-password" is similar, but not identical, to
        the "--protect-prompt" option. The former protects passwords from
        being displayed in the SMTP transaction regardless of how they are
        entered. The latter protects sensitive strings when the user types
        them at the terminal, regardless of how the string would be used.
        (Arg-Optional)

XCLIENT OPTIONS
    XCLIENT is an SMTP extension introduced by the Postfix project. XCLIENT
    allows a (properly-authorized) client to tell a server to use alternate
    information, such as IP address or hostname, for the client. This allows
    much easier paths for testing mail server configurations. Full details
    on the protocol are available at
    <http://www.postfix.org/XCLIENT_README.html>.

    The XCLIENT verb can be passed to the server multiple times per SMTP
    session with different attributes. For instance, HELO and PROTO might be
    passed in one call and NAME and ADDR passed in a second. Because it can
    be useful for testing, Swaks exposes some control over how the
    attributes are grouped and in what order they are passed to the server.
    The different options attempt to expose simplicity for those using Swaks
    as a client, and complexity for those using Swaks to test installs.

    --xclient-addr [<string>]
    --xclient-name [<string>]
    --xclient-port [<string>]
    --xclient-proto [<string>]
    --xclient-destaddr [<string>]
    --xclient-destport [<string>]
    --xclient-helo [<string>]
    --xclient-login [<string>]
    --xclient-reverse-name [<string>]
        These options specify XCLIENT attributes that should be sent to the
        target server. If <string> is not provided, Swaks will prompt and
        read the value on "STDIN". See
        <http://www.postfix.org/XCLIENT_README.html> for official
        documentation for what the attributes mean and their possible
        values, including the special "[UNAVAILABLE]" and "[TEMPUNAVAIL]"
        values.

        By way of simple example, setting "--xclient-name foo.example.com
        --xclient-addr 192.168.1.1" will cause Swaks to send the SMTP
        command "XCLIENT NAME=foo.example.com ADDR=192.168.1.1".

        Note that the "REVERSE_NAME" attribute doesn't seem to appear in the
        official documentation. There is a mailing list thread that
        documents it, viewable at
        <http://comments.gmane.org/gmane.mail.postfix.user/192623>.

        These options can all be mixed with each other, and can be mixed
        with the "--xclient" option (see below). By default all attributes
        will be combined into one XCLIENT call, but see "--xclient-delim".
        (Arg-Required, From-Prompt)

    --xclient-delim
        When this option is specified, it indicates a break in XCLIENT
        attributes to be sent. For instance, setting "--xclient-helo 'helo
        string' --xclient-delim --xclient-name foo.example.com
        --xclient-addr 192.168.1.1" will cause Swaks to send two XCLIENT
        calls, "XCLIENT HELO=helo+20string" and "XCLIENT
        NAME=foo.example.com ADDR=192.168.1.1". This option is ignored where
        it doesn't make sense (at the start or end of XCLIENT options, by
        itself, consecutively, etc). (Arg-None)

    --xclient [<string>]
        This is the "free form" XCLIENT option. Whatever value is provided
        for <string> will be sent verbatim as the argument to the XCLIENT
        SMTP command. For example, if "--xclient 'NAME= ADDR=192.168.1.1
        FOO=bar'" is used, Swaks will send the SMTP command "XCLIENT NAME=
        ADDR=192.168.1.1 FOO=bar". If no argument is passed on command line,
        Swaks will prompt and read the value on STDIN.

        The primary advantage to this over the more specific options above
        is that there is no XCLIENT syntax validation here. This allows you
        to send invalid XCLIENT to the target server for testing.
        Additionally, at least one MTA (Message Systems' Momentum, formerly
        ecelerity) implements XCLIENT without advertising supported
        attributes. The "--xclient" option allows you to skip the "supported
        attributes" check when communicating with this type of MTA (though
        see also "--xclient-no-verify").

        The "--xclient" option can be mixed freely with the "--xclient-*"
        options above. The argument to "--xclient" will be sent in its own
        command group. For instance, if "--xclient-addr 192.168.0.1
        --xclient-port 26 --xclient 'FOO=bar NAME=wind'" is given to Swaks,
        "XCLIENT ADDR=192.168.0.1 PORT=26" and "XCLIENT FOO=bar NAME=wind"
        will both be sent to the target server. (Arg-Required, From-Prompt)

    --xclient-no-verify
        Do not enforce the requirement that an XCLIENT attribute must be
        advertised by the server in order for Swaks to send it in an XCLIENT
        command. This is to support servers which don't advertise the
        attributes but still support them. (Arg-None)

    --xclient-before-starttls
        If Swaks is configured to attempt both XCLIENT and STARTTLS, it will
        do STARTTLS first. If this option is specified it will attempt
        XCLIENT first. (Arg-None)

    --xclient-optional
    --xclient-optional-strict
        In normal operation, setting one of the "--xclient*" options will
        require a successful XCLIENT transaction to take place in order to
        proceed (that is, XCLIENT needs to be advertised, all the
        user-requested attributes need to have been advertised, and the
        server needs to have accepted Swaks' XCLIENT request). These options
        change that behavior. "--xclient-optional" tells Swaks to proceed
        unconditionally past the XCLIENT stage of the SMTP transaction,
        regardless of whether it was successful. "--xclient-optional-strict"
        is similar but more granular. The strict version will continue to
        XCLIENT was not advertised, but will fail if XCLIENT was attempted
        but did not succeed. (Arg-None)

PROXY OPTIONS
    Swaks implements the Proxy protocol as defined in
    <http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt>. Proxy
    allows an application load balancer, such as HAProxy, to be used in
    front of an MTA while still allowing the MTA access to the originating
    host information. Proxy support in Swaks allows direct testing of an MTA
    configured to expect requests from a proxy, bypassing the proxy itself
    during testing.

    Swaks makes no effort to ensure that the Proxy options used are
    internally consistent. For instance, "--proxy-family" (in version 1) is
    expected to be one of "TCP4" or "TCP6". While it will likely not make
    sense to the target server, Swaks makes no attempt to ensure that
    "--proxy-source" and "--proxy-dest" are in the same protocol family as
    "--proxy-family" or each other.

    The "--proxy" option is mutually exclusive with all other "--proxy-*"
    options except "--proxy-version".

    When "--proxy" is not used, all of "--proxy-family", "--proxy-source",
    "--proxy-source-port", "--proxy-dest", and "--proxy-dest-port" are
    required. Additionally, when "--proxy-version" is 2, "--proxy-protocol"
    and "--proxy-command" are optional.

    --proxy-version [ 1 | 2 ]
        Whether to use version 1 (human readable) or version 2 (binary) of
        the Proxy protocol. Version 1 is the default. Version 2 is only
        implemented through the "address block", and is roughly on par with
        the information provided in version 1.

    --proxy [<string>]
        If this option is used, its argument is passed unchanged after the
        "PROXY " portion (or the 12-byte protocol header for version 2) of
        the Proxy exchange. This option allows sending incomplete or
        malformed Proxy strings to a target server for testing. No attempt
        to translate or modify this string is made, so if used with
        "--proxy-version 2" the argument should be in the appropriate binary
        format. This option is mutually exclusive with all other "--proxy-*"
        options which provide granular proxy information. (Arg-Required,
        From-Prompt)

    --proxy-family [<string>]
        For version 1, specifies both the address family and transport
        protocol. The protocol defines TCP4 and TCP6.

        For version 2, specifies only the address family. The protocol
        defines AF_UNSPEC, AF_INET, AF_INET6, and AF_UNIX. (Arg-Required,
        From-Prompt)

    --proxy-protocol [<string>]
        For version 2, specifies the transport protocol. The protocol
        defines UNSPEC, STREAM, and DGRAM. The default is STREAM. This
        option is unused in version 1. (Arg-Required, From-Prompt)

    --proxy-command [<string>]
        For version 2, specifies the transport protocol. The protocol
        defines LOCAL and PROXY. The default is PROXY. This option is unused
        in version 1. (Arg-Required, From-Prompt)

    --proxy-source [<string>]
        Specify the source address of the proxied connection. (Arg-Required,
        From-Prompt)

    --proxy-source-port [<string>]
        Specify the source port of the proxied connection. (Arg-Required,
        From-Prompt)

    --proxy-dest [<string>]
        Specify the destination address of the proxied connection.
        (Arg-Required, From-Prompt)

    --proxy-dest-port [<string>]
        Specify the destination port of the proxied connection.
        (Arg-Required, From-Prompt)

DATA OPTIONS
    These options pertain to the contents for the DATA portion of the SMTP
    transaction. By default a very simple message is sent. If the "--attach"
    or "--attach-body" options are used, Swaks attempts to upgrade to a MIME
    message.

    -d, --data [<data-portion>]
        Use argument as the entire contents of DATA.

        If no argument is provided, user will be prompted to supply value.

        If the argument "-" is provided the data will be read from "STDIN"
        with no prompt.

        If the argument starts with "@" it will be treated as a filename. If
        you would like to pass in an argument that starts with "@" and isn't
        a filename, prefix the argument with an additional "@". For example,
        "@file.txt" will force processing of file.txt. @@data will use the
        string '@data'.

        If the argument does not contain any literal (0x0a) or
        representative (0x5c, 0x6e or %NEWLINE%) newline characters, it will
        be treated as a filename. If the file is open-able, the contents of
        the file will be used as the data portion. If the file cannot be
        opened, Swaks will error and exit. The entire behavior described in
        this paragraph is deprecated and will be removed in a future
        release. Instead use a leading "@" to explicitly set that the
        argument is a filename.

        Any other argument will be used as the DATA contents.

        The value can be on one single line, with "\n" (ASCII 0x5c, 0x6e)
        representing where line breaks should be placed. Leading dots will
        be quoted. Closing dot is not required but is allowed. The default
        value for this option is "Date: %DATE%\nTo: %TO_ADDRESS%\nFrom:
        %FROM_ADDRESS%\nSubject: test %DATE%\nMessage-Id:
        <%MESSAGEID%"\nX-Mailer: swaks v%SWAKS_VERSION%
        jetmore.org/john/code/swaks/\n%NEW_HEADERS%\n%BODY%\n>.

        Very basic token parsing is performed on the DATA portion. The
        following table shows the recognized tokens and their replacement
        values. (Arg-Required, From-Prompt, From-File)

        %FROM_ADDRESS%
            Replaced with the envelope-sender.

        %TO_ADDRESS%
            Replaced with the envelope-recipient(s).

        %DATE%
            Replaced with the current time in a format suitable for
            inclusion in the Date: header. Note this attempts to use the
            standard module POSIX for timezone calculations. If this module
            is unavailable the date string will be in GMT.

        %MESSAGEID%
            Replaced with a message ID string suitable for use in a
            Message-Id header. The value for this token will remain
            consistent for the life of the process.

        %SWAKS_VERSION%
            Replaced with the version of the currently-running Swaks
            process.

        %NEW_HEADERS%
            Replaced with the contents of the "--add-header" option. If
            "--add-header" is not specified this token is simply removed.

        %BODY%
            Replaced with the value specified by the "--body" option. See
            "--body" for default.

        %NEWLINE%
            Replaced with carriage return, newline (0x0d, 0x0a). This is
            identical to using "\n" (0x5c, 0x6e), but doesn't have the
            escaping concerns that the backslash can cause on the newline.

    -dab, --dump-as-body [<section>[,<section>[,...]]]
        If "--dump-as-body" is used and no other option is used to change
        the default body of the message, the body is replaced with output
        similar to the output of what is provided by "--dump". "--dump"'s
        initial program capability stanza is not displayed, and the "data"
        section is not included. Additionally, "--dump" always includes
        passwords. By default "--dump-as-body" does not include passwords,
        though this can be changed with "--dump-as-body-shows-password".
        "--dump-as-body" takes the same arguments as "--dump" except the
        SUPPORT and DATA arguments are not supported. (Arg-Optional)

    -dabsp, --dump-as-body-shows-password
        Cause "--dump-as-body" to include plaintext passwords. This option
        is not recommended. This option implies "--dump-as-body". (Arg-None)

    --body [<body-specification>]
        Specify the body of the email. The default is "This is a test
        mailing". If no argument to "--body" is given, prompt to supply one
        interactively. If "-" is supplied, the body will be read from
        standard input. Arguments beginning with "@" will be treated as
        filenames containing the body data to use (see "--data" for more
        detail).

        If, after the above processing, the argument represents an open-able
        file, the content of that file is used as the body. This is
        deprecated behavior and will be removed in a future release. Instead
        use a leading "@" to explicitly set that the argument is a filename.

        If the message is forced to MIME format (see "--attach") "--body
        'body text'" is the same as "--attach-type text/plain --attach-body
        'body text'". See "--attach-body" for details on creating a
        multipart/alternative body. (Arg-Required, From-Prompt, From-File)

    --attach [<attachment-specification>]
        When one or more "--attach" option is supplied, the message is
        changed into a multipart/mixed MIME message. The arguments to
        "--attach" are processed the same as "--body" with respect to
        "STDIN", file contents, etc. "--attach" can be supplied multiple
        times to create multiple attachments. By default, each attachment is
        attached as an application/octet-stream file. See "--attach-type"
        for changing this behavior.

        If the contents of the attachment are provided via a file name, the
        MIME encoding will include that file name. See "--attach-name" for
        more detail on file naming.

        It is legal for "-" ("STDIN") to be specified as an argument
        multiple times (once for "--body" and multiple times for
        "--attach"). In this case, the same content will be attached each
        time it is specified. This is useful for attaching the same content
        with multiple MIME types. (Arg-Required, From-File)

    --attach-body [<body-specification>]
        This is a variation on "--attach" that is specifically for the body
        part of the email. It behaves identically to "--attach" in that it
        takes the same arguments and forces the creation of a MIME message.
        However, it is different in that the argument will always be the
        first MIME part in the message, no matter where in option processing
        order it is encountered. Additionally, "--attach-body" options stack
        to allow creation of multipart/alternative bodies. For example,
        "--attach-type text/plain --attach-body 'plain text body'
        --attach-type text/html --attach-body 'html body'" would create a
        multipart/alternative message body. (Arg-Required, From-File)

    --attach-type <mime-type>
        By default, content that gets MIME attached to a message with the
        "--attach" option is encoded as application/octet-stream (except for
        the body, which is text/plain by default). "--attach-type" changes
        the mime type for every "--attach" option which follows it. It can
        be specified multiple times. The current MIME type gets reset to
        application/octet-stream between processing body parts and other
        parts. (Arg-Required)

    --attach-name [<name>]
        This option sets the filename that will be included in the MIME part
        created for the next "--attach" option. If no argument is set for
        this option, it causes no filename information to be included for
        the next MIME part, even if Swaks could generate it from the local
        file name. (Arg-Optional)

    -ah, --add-header <header>
        This option allows headers to be added to the DATA. If
        "%NEW_HEADERS%" is present in the DATA it is replaced with the
        argument to this option. If "%NEW_HEADERS%" is not present, the
        argument is inserted between the first two consecutive newlines in
        the DATA (that is, it is inserted at the end of the existing
        headers).

        The option can either be specified multiple times or a single time
        with multiple headers separated by a literal "\n" string. So,
        "--add-header 'Foo: bar' --add-header 'Baz: foo'" and "--add-header
        'Foo: bar\nBaz: foo'" end up adding the same two headers.
        (Arg-Required)

    --header <header-and-data>, --h-<header> <data>
        These options allow a way to change headers that already exist in
        the DATA. "--header 'Subject: foo'" and "--h-Subject foo" are
        equivalent. If the header does not already exist in the data then
        this argument behaves identically to "--add-header". However, if the
        header already exists it is replaced with the one specified.
        Negating the version of this option with the header name in the
        option (eg "--no-header-Subject") will remove all previously
        processed "--header" options, not just the ones used for 'Subject'.
        (Arg-Required)

    -g  This option is a direct alias to "--data -" (read DATA from
        "STDIN"). It is totally secondary to "--data". Any occurrence of
        "--data" will cause "-g" to be ignored. This option cannot be
        negated with the "no-" prefix. This option is deprecated and will be
        removed in a future version of Swaks. (Arg-None, Deprecated)

    --no-data-fixup, -ndf
        This option forces Swaks to do no massaging of the DATA portion of
        the email. This includes token replacement, From_ stripping,
        trailing-dot addition, "--body"/attachment inclusion, and any header
        additions. This option is only useful when used with "--data", since
        the internal default DATA portion uses tokens. (Arg-None)

    --no-strip-from, -nsf
        Don't strip the From_ line from the DATA portion, if present.
        (Arg-None)

OUTPUT OPTIONS
    Swaks provides a transcript of its transactions to its caller
    ("STDOUT"/"STDERR") by default. This transcript aims to be as faithful a
    representation as possible of the transaction though it does modify this
    output by adding informational prefixes to lines and by providing
    plaintext versions of TLS transactions

    The "informational prefixes" are referred to as transaction hints. These
    hints are initially composed of those marking lines that are output of
    Swaks itself, either informational or error messages, and those that
    indicate a line of data actually sent or received in a transaction. This
    table indicates the hints and their meanings:

    "==="
        Indicates an informational line generated by Swaks.

    "***"
        Indicates an error generated within Swaks.

    " ->"
        Indicates an expected line sent by Swaks to target server.

    " ~>"
        Indicates a TLS-encrypted, expected line sent by Swaks to target
        server.

    "**>"
        Indicates an unexpected line sent by Swaks to the target server.

    "*~>"
        Indicates a TLS-encrypted, unexpected line sent by Swaks to target
        server.

    "  >"
        Indicates a raw chunk of text sent by Swaks to a target server (see
        "--show-raw-text"). There is no concept of "expected" or
        "unexpected" at this level.

    "<- "
        Indicates an expected line sent by target server to Swaks.

    "<~ "
        Indicates a TLS-encrypted, expected line sent by target server to
        Swaks.

    "<**"
        Indicates an unexpected line sent by target server to Swaks.

    "<~*"
        Indicates a TLS-encrypted, unexpected line sent by target server to
        Swaks.

    "<  "
        Indicates a raw chunk of text received by Swaks from a target server
        (see "--show-raw-text"). There is no concept of "expected" or
        "unexpected" at this level.

    The following options control what and how output is displayed to the
    caller.

    -n, --suppress-data
        Summarizes the DATA portion of the SMTP transaction instead of
        printing every line. This option is very helpful, bordering on
        required, when using Swaks to send certain test emails. Emails with
        attachments, for instance, will quickly overwhelm a terminal if the
        DATA is not suppressed. (Arg-None)

    -stl, --show-time-lapse [i]
        Display time lapse between send/receive pairs. This option is most
        useful when Time::HiRes is available, in which case the time lapse
        will be displayed in thousandths of a second. If Time::HiRes is
        unavailable or "i" is given as an argument the lapse will be
        displayed in integer seconds only. (Arg-Optional)

    -nih, --no-info-hints
        Don't display the transaction hint for informational transactions.
        This is most useful when needing to copy some portion of the
        informational lines, for instance the certificate output from
        "--tls-get-peer-cert". (Arg-None)

    -nsh, --no-send-hints
    -nrh, --no-receive-hints
    -nth, --no-hints
        "--no-send-hints" and "--no-receive-hints" suppress the transaction
        hints from send and receive lines, respectively. This is often
        useful when copying some portion of the transaction for use
        elsewhere (for instance, "--no-send-hints --hide-receive
        --hide-informational" is a useful way to get only the client-side
        commands for a given transaction). "--no-hints" is identical to
        specifying both "--no-send-hints" and "--no-receive-hints".
        (Arg-None)

    -raw, --show-raw-text
        This option will print a hex dump of raw data sent and received by
        Swaks. Each hex dump is the contents of a single read or write on
        the network. This should be identical to what is already being
        displayed (with the exception of the "\r" characters being removed).
        This option is useful in seeing details when servers are sending
        lots of data in single packets, or breaking up individual lines into
        multiple packets. If you really need to go in depth in that area
        you're probably better with a packet sniffer, but this option is a
        good first step to seeing odd connection issues. (Arg-None)

    --output, --output-file <file-path>
    --output-file-stdout <file-path>
    --output-file-stderr <file-path>
        These options allow the user to send output to files instead of
        "STDOUT"/"STDERR". The first option sends both to the same file. The
        arguments of &STDOUT and &STDERR are treated specially, referring to
        the "normal" file handles, so "--output-file-stderr '&STDOUT'" would
        redirect "STDERR" to "STDOUT". These options are honored for all
        output except "--help" and "--version". (Arg-Required)

    -pp, --protect-prompt
        Don't echo user input on prompts that are potentially sensitive
        (right now only authentication password). Very specifically, any
        option which is marked 'Sensitive' and eventually prompts for an
        argument will do its best to mask that argument from being echoed.
        See also "--auth-hide-password". (Arg-None)

    -hr, --hide-receive
        Don't display lines sent from the remote server being received by
        Swaks. (Arg-None)

    -hs, --hide-send
        Don't display lines being sent by Swaks to the remote server.
        (Arg-None)

    -hi, --hide-informational
        Don't display non-error informational lines from Swaks itself.
        (Arg-None)

    -ha, --hide-all
        Do not display any content to the terminal. (Arg-None)

    -S, --silent [ 1 | 2 | 3 ]
        Cause Swaks to be silent. If no argument is given or if an argument
        of "1" is given, print no output unless/until an error occurs, after
        which all output is shown. If an argument of "2" is given, only
        print errors. If "3" is given, show no output ever. "--silent"
        affects most output but not all. For instance, "--help",
        "--version", "--dump", and "--dump-mail" are not affected.
        (Arg-Optional)

    --support
        Print capabilities and exit. Certain features require non-standard
        Perl modules. This option evaluates whether these modules are
        present and displays which functionality is available and which
        isn't, and which modules would need to be added to gain the missing
        functionality. (Arg-None)

    --dump-mail
        Cause Swaks to process all options to generate the message it would
        send, then print that message to "STDOUT" instead of sending it.
        This output is identical to the "data" section of "--dump", except
        without the trailing dot. (Arg-None)

    --dump [<section>[,<section>[,...]]]
        This option causes Swaks to print the results of option processing,
        immediately before mail would have been sent. No mail will be sent
        when "--dump" is used. Note that "--dump" is a pure self-diagnosis
        tool and no effort is made or will ever be made to mask passwords in
        the "--dump" output. If a section is provided as an argument to this
        option, only the requested section will be shown. Currently
        supported arguments are SUPPORT, APP, OUTPUT, TRANSPORT, PROTOCOL,
        XCLIENT, PROXY, TLS, AUTH, DATA, and ALL. If no argument is
        provided, all sections are displayed (Arg-Optional)

    --help
        Display this help information and exit. (Arg-None)

    --version
        Display version information and exit. (Arg-None)

DEPRECATIONS
    The following features are deprecated and will be removed in a future
    version of Swaks

    -g option
        Will be removed no sooner than November 1, 2021.

        The -g option is currently a less-good alias to "--data -". Any uses
        of "-g" should be able to be directly migrated to "--data -"
        instead.

    auto-filename detection
        Will be removed no sooner than November 1, 2021.

        The "--data", "--body", "--attach", and "--attach-body" options
        currently will attempt to distinguish between an argument that is
        the actual value to use vs. an argument that represents a file
        containing the data to use. This behavior has been superseded by
        prefixing an argument to these options with "@" to explicitly
        indicate that the argument indicates a file. Any uses of providing a
        filename to one of these options should be moved to using "@" to
        indicate a filename is being used.

PORTABILITY
    OPERATING SYSTEMS
        This program was primarily intended for use on UNIX-like operating
        systems, and it should work on any reasonable version thereof. It
        has been developed and tested on Solaris, Linux, and Mac OS X and is
        feature complete on all of these.

        This program is known to demonstrate basic functionality on Windows
        using ActiveState's Perl. It has not been fully tested. Known to
        work are basic SMTP functionality and the LOGIN, PLAIN, and CRAM-MD5
        auth types. Unknown is any TLS functionality and the NTLM/SPA and
        DIGEST-MD5 auth types.

        Because this program should work anywhere Perl works, I would
        appreciate knowing about any new operating systems you've thoroughly
        used Swaks on as well as any problems encountered on a new OS.

    MAIL SERVERS
        This program was almost exclusively developed against Exim mail
        servers. It has been used casually by the author, though not
        thoroughly tested, with Sendmail, Smail, Exchange, Oracle
        Collaboration Suite, qpsmtpd, and Communigate. Because all
        functionality in Swaks is based on known standards it should work
        with any fairly modern mail server. If a problem is found, please
        alert the author at the address below.

ENVIRONMENT VARIABLES
    LOGNAME
        If Swaks must create a sender address, $LOGNAME is used as the
        message local-part if it is set, and unless "--force-getpwuid" is
        used.

    SWAKS_HOME
        Used when searching for a .swaksrc configuration file. See OPTION
        PROCESSING -> "CONFIGURATION FILES" above.

    SWAKS_OPT_*
        Environment variable prefix used to specify Swaks options from
        environment variables. See OPTION PROCESSING -> "CONFIGURATION
        ENVIRONMENT VARIABLES" above.

EXIT CODES
    0   no errors occurred

    1   error parsing command line options

    2   error connecting to remote server

    3   unknown connection type

    4   while running with connection type of "pipe", fatal problem writing
        to or reading from the child process

    5   while running with connection type of "pipe", child process died
        unexpectedly. This can mean that the program specified with "--pipe"
        doesn't exist.

    6   Connection closed unexpectedly. If the close is detected in response
        to the 'QUIT' Swaks sends following an unexpected response, the
        error code for that unexpected response is used instead. For
        instance, if a mail server returns a 550 response to a MAIL FROM:
        and then immediately closes the connection, Swaks detects that the
        connection is closed, but uses the more specific exit code 23 to
        detail the nature of the failure. If instead the server return a 250
        code and then immediately closes the connection, Swaks will use the
        exit code 6 because there is not a more specific exit code.

    10  error in prerequisites (needed module not available)

    21  error reading initial banner from server

    22  error in HELO transaction

    23  error in MAIL transaction

    24  no RCPTs accepted

    25  server returned error to DATA request

    26  server did not accept mail following data

    27  server returned error after normal-session quit request

    28  error in AUTH transaction

    29  error in TLS transaction

    30  PRDR requested/required but not advertised

    32  error in EHLO following TLS negotiation

    33  error in XCLIENT transaction

    34  error in EHLO following XCLIENT

    35  error in PROXY option processing

    36  error sending PROXY banner

ABOUT THE NAME
    The name "Swaks" is a (sort-of) acronym for "SWiss Army Knife SMTP". It
    was chosen to be fairly distinct and pronounceable. While "Swaks" is
    unique as the name of a software package, it has some other,
    non-software meanings. Please send in other uses of "swak" or "swaks"
    for inclusion.

    "Sealed With A Kiss"
        SWAK/SWAKs turns up occasionally on the internet with the meaning
        "with love".

    bad / poor / ill (Afrikaans)
        Seen in the headline "SA se bes en swaks gekledes in 2011", which
        was translated as "best and worst dressed" by native speakers.
        Google Translate doesn't like "swaks gekledes", but it will
        translate "swak" as "poor" and "swak geklede" as "ill-dressed".

LICENSE
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
    Free Software Foundation; either version 2 of the License, or (at your
    option) any later version.

    This program is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
    Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.

CONTACT INFORMATION
    General contact, questions, patches, requests, etc to
    [email protected].

    Change logs, this help, and the latest version are found at
    <http://www.jetmore.org/john/code/swaks/>.

    Swaks is crafted with love by John Jetmore from the cornfields of
    Indiana, United States of America.

NOTIFICATIONS
    Email
        [email protected]

        If you would like to be put on a list to receive notifications when
        a new version of Swaks is released, please send an email to this
        address. There will not be a response to your email.

    Website
        <http://www.jetmore.org/john/blog/c/swaks/>

    RSS Feed
        <http://www.jetmore.org/john/blog/c/swaks/feed/>

    Twitter
        <http://twitter.com/SwaksSMTP>

Guess you like

Origin blog.csdn.net/zhoqua697/article/details/130841380