diff --git a/.gitignore b/.gitignore index d2c19479..32b2e3bf 100644 --- a/.gitignore +++ b/.gitignore @@ -19,10 +19,18 @@ Thumbs.db *.tmp *.log *.lock +tmp/* *.csr *.key *.crt +*.pem +!testing/certs/*.csr +!testing/certs/*.key +!testing/certs/*.crt +!testing/certs/*.pem + +testing/mta/*-install # sublime project files *.sublime-project diff --git a/App-swaks/Changes b/App-swaks/Changes index 3998341b..1dcbe852 100644 --- a/App-swaks/Changes +++ b/App-swaks/Changes @@ -1,6 +1,11 @@ Revision history for Perl extension App::swaks. -20201014.0 Web Oct 14 17:00:00 2020 +20240103.0 Wed Jan 3 17:00:00 2024 + - tracking Swaks release 20240103.0. See + http://jetmore.org/john/code/swaks/versions.html + for full details. + +20201014.0 Wed Oct 14 17:00:00 2020 - tracking Swaks release 20201014.0. See http://jetmore.org/john/code/swaks/versions.html for full details. diff --git a/App-swaks/Makefile.PL b/App-swaks/Makefile.PL index be948c6e..fbbc1a65 100644 --- a/App-swaks/Makefile.PL +++ b/App-swaks/Makefile.PL @@ -4,7 +4,7 @@ use ExtUtils::MakeMaker; # the contents of the Makefile that is written. WriteMakefile( NAME => 'App::swaks', - VERSION => '20201014.0', + VERSION => '20240103.0', ABSTRACT => 'Swiss Army Knife for SMTP testing', AUTHOR => 'John Jetmore ', LICENSE => 'gpl', diff --git a/App-swaks/README b/App-swaks/README index c5806627..2fc8e1ee 100644 --- a/App-swaks/README +++ b/App-swaks/README @@ -1,4 +1,4 @@ -App-swaks version 20201014.0 +App-swaks version 20240103.0 ====================== App::swaks is a perl package which distributes the Swaks SMTP test @@ -27,7 +27,7 @@ modules may be desired. COPYRIGHT AND LICENSE -Copyright (c) 2003-2008,2010-2020 John Jetmore +Copyright (c) 2003-2008,2010-2024 John Jetmore 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 diff --git a/Changes b/Changes index 657b2f72..843bd614 100644 --- a/Changes +++ b/Changes @@ -929,3 +929,119 @@ processing overhaul in a46b929 #26 * 20201014 Add newline echo after entering password with --protect-prompt > 20201014 released 20201014.0 +* 20201016 Testing: Document and improve automated testing to make it easier + for new users to run in new environments +* 20201018 Change script interpreter line to use /usr/bin/env for portability +* 20201018 Testing: Add --winnow to run-all.pl +* 20201030 Fix date generation by confirming environment's strftime supports + %z format token. Windows supports strftime but not %z. +* 20201030 Windows: use binmode on STDERR/STDOUT to prevent line ending + translation. +* 20201031 Windows: Fix setting options via environment variable (this fix + now means that -S is not supported on Windows) +* 20201031 Windows: Explicitly revoke support for providing header names + embedded in environment variable names (%SWAKS_OPT_header_From% + will result in an error) +* 20201031 Allow a value of '<>' in an environment variable to mean empty + string. Usable everywhere, but needed on Windows since it doesn't + support set-but-empty environment variables. +* 20201101 Windows: Allow LOGNAME environment variable to override default + email sender +* 20201101 Change the generation of help text from a manual perldoc call to + Pod::Usage +* 20201106 Testing: Extensive changes to allow test tools to run on Windows + cmd.exe +* 20201107 Add ..TOKEN.. form of tokens to more-easily allow tokens to be + specified from Windows command line. +* 20201116 Previously changed %DATE% to %MESSAGE_ID% in some tests to protect + against accidental expansion on Windows. Change back to ..DATE.. + now that it's an option. +* 20201126 Add tools for visualizing errors caused by line ending issues +* 20201126 Rework interactive tests and enable on Windows +* 20201126 Turn releases back on and add release for v20201024.0 (#13) +* 20201126 --output-file (and -stdout and -stderr) now truncate the output + file if it already existed. +* 20201126 --port and --local-port should override a port set in --server or + --local-interface. +* 20201222 Add transaction-level tests +* 20201223 Add missing option hints from --proxy-version documentation +* 20201223 Remove documentation note about which Authen::NTLM version to use, + there's only one on CPAN anymore. +* 20201223 When an unsupported XCLIENT attribute is requested, print the + missing attribute in the error. +* 20201223 Don't print "Exiting" in the XCLIENT attempted but failed message. + It is always unnecessary (Auth doesn't print it) and is wrong + when --xclient-optional is in use. +* 20201223 Fix several --drop-after-send bugs and inconsistencies. +* 20201224 Fix --quit-after/--drop-after/--drop-after-send with XCLIENT + stop-point when XCLIENT is not negotiated. +* 20201224 Add new stop-point XCLIENT-HELO to address lack of specificity + when mixing XCLIENT and HELO stop-point. +* 20201224 In --dump output, print a raw proxy string in base64 if version 2 +* 20201224 --proxy argument can now (optionally) be provided with the protocol + prefix. +* 20201224 Allow --proxy to read string from a file, and allow it to be + base64 encoded. +* 20201224 Change error message when missing --proxy* option to list every + missing option instead of just the first missing. +* 20201224 --no-hints should also include --no-info-hints, analogous to + --hide-informational/--hide-all which already worked this way. +* 20201225 Add autocat feature to test tools +* 20201225 Add exit code checking to regression tests +* 20210116 Fix dead link to openssl cipher list format documentation in + --tls-cipher doc. +* 20210116 Update copyright year to 2021 +* 20210116 Add TLS informational line showing whether client certificate was + by the server and whether swaks sent it. +* 20210116 Use named constant in TLS code instead of magic number +* 20210117 Add TLS informational line showing the verification status of + the server certificate. +* 20210117 Change --tls-verify to require both cert and hostname verification. + Add --tls-verify-ca (previous behavior of --tls-verify) and + --tls-verify-host to just require verification of the certificate + against the local CA or the target hostname or IP, respectively. +* 20210117 Add --tls-verify-target to set a host to be used for verification, + overriding the internal connection information. +* 20210123 Clarify --auth-optional-strict documentation +* 20210123 Adding --cc and --bcc options. +* 20210123 Add PROXY as a valid --quit-after, --drop-after, and + --drop-after-send argument. +* 20211208 Fix deprecated use of --body in doc (#39) +* 20220505 Update copyright year to 2022 +* 20220505 Fix double-entry for Linux on installations.html #46 +* 20220505 Fix broken POD formatting for the default --data argument #47 +* 20231103 Update copyright year to 2023 +* 20231103 Fix unreliable results certificate/hostname verification +* 20231104 Switch to using IO::Socket::IP by default. Fall back to + IO::Socket::INET/INET6; deprecate the use of these libraries #43 +* 20231105 Remove deprecated ability to infer filename vs. inline data for + --data, --body, --attach, and --attach-body options +* 20231105 Fix bug which caused the "I really mean a filename" @sigil to + be included in the attachment filename in the body of the email. + It is now stripped from the filename before use (#55) +* 20231110 implement --tls-chain (based on initial implementation by + Wolfgang Karall-Ahlborn in #60) +* 20231126 In prep for handling peer chains properly, change the printing + of local cert labeling from local/chain to local[i], but + only if there is more than one local cert. +* 20231130 Flesh out printing of certs to include notBefore/After, + commonName (not as part of the DN), and subjectAltName +* 20231130 Show debug for entire peer cert chain, not just for the end + cert (#73) +* 20231202 Add --tls-get-peer-chain option. Analogous to --tls-get-peer-cert + but shows every cert sent by the peer, not just the first one (#72) +* 20231203 Reorganize TLS internals to make support easier +* 20231203 Switch method for getting peer certs, making debug way more + reliable +* 20231203 Clean up the output when we print local and peer cert info, make it + more compact and uniform +* 20240102 Update copyright year to 2024 +* 20240102 Print all available certificate information even if TLS was not + successfully negotiated +* 20240102 Rework tls verification. On cert verification failure, print + openssl's error message. Get rid of verify callback. +* 20240102 Clarify --tls-verify-ca docs, this verifies both signing and + date expiration (notBefore/notAfter) +* 20240103 Previously-deprecated option -g removed entirely +* 20240103 Improve test suite experience on FreeBSD +> 20240102 released 20240102.0 diff --git a/README.md b/README.md index fe511de9..917ec1a8 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ The official project page is . ## Download -The latest version of Swaks is **20201014.0** ([announcement][release_announce]), which can be downloaded as a [package][release_package] or a [standalone script][release_script]. +The latest version of Swaks is **20240103.0** ([announcement][release_announce]), which can be downloaded as a [package][release_package] or a [standalone script][release_script]. See the [installation page][installation_page] for details on installing in multiple environments. @@ -52,7 +52,7 @@ Feedback and meaningful questions about how to use Swaks are welcome. However, s [issues]: https://github.com/jetmore/swaks/issues [blog]: https://www.jetmore.org/john/blog/c/swaks/ [blog_rss]: https://www.jetmore.org/john/blog/c/swaks/feed/ -[release_announce]: https://www.jetmore.org/john/blog/2020/10/swaks-release-20201014-0-available/ -[release_package]: https://jetmore.org/john/code/swaks/files/swaks-20201014.0.tar.gz -[release_script]: https://jetmore.org/john/code/swaks/files/swaks-20201014.0/swaks -[rendered_doc]: https://github.com/jetmore/swaks/blob/v20201014.0/doc/base.pod +[release_announce]: https://www.jetmore.org/john/blog/2020/10/swaks-release-20240103-0-available/ +[release_package]: https://jetmore.org/john/code/swaks/files/swaks-20240103.0.tar.gz +[release_script]: https://jetmore.org/john/code/swaks/files/swaks-20240103.0/swaks +[rendered_doc]: https://github.com/jetmore/swaks/blob/v20240103.0/doc/base.pod diff --git a/RELEASE/README.txt b/RELEASE/README.txt index e2a7bff8..1991618c 100644 --- a/RELEASE/README.txt +++ b/RELEASE/README.txt @@ -19,13 +19,15 @@ missing functionality, and how to get that functionality. Example output: === Basic AUTH supported === Date Manipulation supported === High Resolution Timing supported - === IPv6 supported + === IPv4/v6 Socket Transport supported + === Legacy IPv4 Socket Transport supported + === Legacy IPv4/v6 Socket Transport supported === Local Hostname Detection supported === MX Routing supported === Netrc Credentials supported === Pipe Transport supported - === Socket Transport supported === TLS supported + === UNIX Socket Transport supported ------------------------------ Documentation @@ -88,16 +90,38 @@ A full copy of this license should be available in the LICENSE.txt file. ------------------------------ Change Summary ------------------------------ -v20201014.0 +v20240103.0 New Features: - * None + * Added --cc and --bcc options + * Numerous TLS debugging and verification improvements + * Debug output contains whether a client cert was requested and whether + one was sent + * Add new options --tls-verify-ca and --tls-verify-host to differentiate + between types of certificate verification (--tls-verify does both) + * Add --tls-target option to allow setting of hostname to be used in + hostname verification. This is useful in some inet debugging situations + and required to do hostname verification with --socket or --pipe + * Add --tls-chain (#60, initial implementation by Wolfgang Karall-Ahlborn) + * Add --tls-get-peer-chain option (analogous to --tls-get-peer-cert, #73) + * Certificate debug now includes all client and peer certs, it a chain + was used (#73) + * Certificate debug now includes notAfter, commonName, and subjectAltName Notable Changes: - * None + * --output-file, --output-file-stderr, and --output-file-stdout now truncate + the specified file if it already exists + * Documentation improvements + * Extensive test harness improvements + * Add new stop-point XCLIENT-HELO to address lack of specificity when + mixing XCLIENT usage with the HELO stop-point + * Add new stop-point PROXY + * Use IO::Socket::IP by default. Will still use IO::Socket::INET/INET6 + to cover transition, but this is deprecated and will be removed in the + future (#43) + * TLS session debug information is now printed even if we decide not to + continue the session (eg for failed verification) + * Previously-deprecated functionality to allow some options to be either + a filename or a literal string has been removed. Using the '@' sigil is + now the only was to specify file contents + * Previously-deprecated -g option removed Notable Bugs Fixed: - * Last release introduced a bug where Date: headers were localized, which - is against RFC. Further, that localization then broke character rendering - in some locales. A new fix for the original issue (#17) was put in place, - which no longer localizes the Date: header and fixes the newly introduced - rendering issue (#25) - * Last release introduced a bug which prevented --protect-prompt from - working. This is now fixed (#26) + * TLS certificate verification did not always work. It should now diff --git a/RELEASE/doc/Changes.txt b/RELEASE/doc/Changes.txt index d6991797..2b2896b3 100644 --- a/RELEASE/doc/Changes.txt +++ b/RELEASE/doc/Changes.txt @@ -1,3 +1,119 @@ +> 20240102 released 20240102.0 +* 20240103 Improve test suite experience on FreeBSD +* 20240103 Previously-deprecated option -g removed entirely +* 20240102 Clarify --tls-verify-ca docs, this verifies both signing and + date expiration (notBefore/notAfter) +* 20240102 Rework tls verification. On cert verification failure, print + openssl's error message. Get rid of verify callback. +* 20240102 Print all available certificate information even if TLS was not + successfully negotiated +* 20240102 Update copyright year to 2024 +* 20231203 Clean up the output when we print local and peer cert info, make it + more compact and uniform +* 20231203 Switch method for getting peer certs, making debug way more + reliable +* 20231203 Reorganize TLS internals to make support easier +* 20231202 Add --tls-get-peer-chain option. Analogous to --tls-get-peer-cert + but shows every cert sent by the peer, not just the first one (#72) +* 20231130 Show debug for entire peer cert chain, not just for the end + cert (#73) +* 20231130 Flesh out printing of certs to include notBefore/After, + commonName (not as part of the DN), and subjectAltName +* 20231126 In prep for handling peer chains properly, change the printing + of local cert labeling from local/chain to local[i], but + only if there is more than one local cert. +* 20231110 implement --tls-chain (based on initial implementation by + Wolfgang Karall-Ahlborn in #60) +* 20231105 Fix bug which caused the "I really mean a filename" @sigil to + be included in the attachment filename in the body of the email. + It is now stripped from the filename before use (#55) +* 20231105 Remove deprecated ability to infer filename vs. inline data for + --data, --body, --attach, and --attach-body options +* 20231104 Switch to using IO::Socket::IP by default. Fall back to + IO::Socket::INET/INET6; deprecate the use of these libraries #43 +* 20231103 Fix unreliable results certificate/hostname verification +* 20231103 Update copyright year to 2023 +* 20220505 Fix broken POD formatting for the default --data argument #47 +* 20220505 Fix double-entry for Linux on installations.html #46 +* 20220505 Update copyright year to 2022 +* 20211208 Fix deprecated use of --body in doc (#39) +* 20210123 Add PROXY as a valid --quit-after, --drop-after, and + --drop-after-send argument. +* 20210123 Adding --cc and --bcc options. +* 20210123 Clarify --auth-optional-strict documentation +* 20210117 Add --tls-verify-target to set a host to be used for verification, + overriding the internal connection information. +* 20210117 Change --tls-verify to require both cert and hostname verification. + Add --tls-verify-ca (previous behavior of --tls-verify) and + --tls-verify-host to just require verification of the certificate + against the local CA or the target hostname or IP, respectively. +* 20210117 Add TLS informational line showing the verification status of + the server certificate. +* 20210116 Use named constant in TLS code instead of magic number +* 20210116 Add TLS informational line showing whether client certificate was + by the server and whether swaks sent it. +* 20210116 Update copyright year to 2021 +* 20210116 Fix dead link to openssl cipher list format documentation in + --tls-cipher doc. +* 20201225 Add exit code checking to regression tests +* 20201225 Add autocat feature to test tools +* 20201224 --no-hints should also include --no-info-hints, analogous to + --hide-informational/--hide-all which already worked this way. +* 20201224 Change error message when missing --proxy* option to list every + missing option instead of just the first missing. +* 20201224 Allow --proxy to read string from a file, and allow it to be + base64 encoded. +* 20201224 --proxy argument can now (optionally) be provided with the protocol + prefix. +* 20201224 In --dump output, print a raw proxy string in base64 if version 2 +* 20201224 Add new stop-point XCLIENT-HELO to address lack of specificity + when mixing XCLIENT and HELO stop-point. +* 20201224 Fix --quit-after/--drop-after/--drop-after-send with XCLIENT + stop-point when XCLIENT is not negotiated. +* 20201223 Fix several --drop-after-send bugs and inconsistencies. +* 20201223 Don't print "Exiting" in the XCLIENT attempted but failed message. + It is always unnecessary (Auth doesn't print it) and is wrong + when --xclient-optional is in use. +* 20201223 When an unsupported XCLIENT attribute is requested, print the + missing attribute in the error. +* 20201223 Remove documentation note about which Authen::NTLM version to use, + there's only one on CPAN anymore. +* 20201223 Add missing option hints from --proxy-version documentation +* 20201222 Add transaction-level tests +* 20201126 --port and --local-port should override a port set in --server or + --local-interface. +* 20201126 --output-file (and -stdout and -stderr) now truncate the output + file if it already existed. +* 20201126 Turn releases back on and add release for v20201024.0 (#13) +* 20201126 Rework interactive tests and enable on Windows +* 20201126 Add tools for visualizing errors caused by line ending issues +* 20201116 Previously changed %DATE% to %MESSAGE_ID% in some tests to protect + against accidental expansion on Windows. Change back to ..DATE.. + now that it's an option. +* 20201107 Add ..TOKEN.. form of tokens to more-easily allow tokens to be + specified from Windows command line. +* 20201106 Testing: Extensive changes to allow test tools to run on Windows + cmd.exe +* 20201101 Change the generation of help text from a manual perldoc call to + Pod::Usage +* 20201101 Windows: Allow LOGNAME environment variable to override default + email sender +* 20201031 Allow a value of '<>' in an environment variable to mean empty + string. Usable everywhere, but needed on Windows since it doesn't + support set-but-empty environment variables. +* 20201031 Windows: Explicitly revoke support for providing header names + embedded in environment variable names (%SWAKS_OPT_header_From% + will result in an error) +* 20201031 Windows: Fix setting options via environment variable (this fix + now means that -S is not supported on Windows) +* 20201030 Windows: use binmode on STDERR/STDOUT to prevent line ending + translation. +* 20201030 Fix date generation by confirming environment's strftime supports + %z format token. Windows supports strftime but not %z. +* 20201018 Testing: Add --winnow to run-all.pl +* 20201018 Change script interpreter line to use /usr/bin/env for portability +* 20201016 Testing: Document and improve automated testing to make it easier + for new users to run in new environments > 20201014 released 20201014.0 * 20201014 Add newline echo after entering password with --protect-prompt * 20201014 Fix --protect-prompt. Not implemented correctly after option diff --git a/RELEASE/doc/ref.txt b/RELEASE/doc/ref.txt index 760d4ca4..5bc1999f 100644 --- a/RELEASE/doc/ref.txt +++ b/RELEASE/doc/ref.txt @@ -33,7 +33,7 @@ QUICK START Test a spam scanner using GTUBE in the body of an email, routed via the MX records for example.com: - swaks --to user@example.com --body /path/to/gtube/file + swaks --to user@example.com --body @/path/to/gtube/file Deliver a standard test email to user@example.com using the LMTP protocol via a UNIX domain socket file @@ -192,9 +192,13 @@ OPTION PROCESSING 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. + file can't be read, Swaks will exit. To specify a literal string + value starting with an "@", use two "@" symbols. The first will be + stripped. It is not possible to include an unqualified file which + starts with an "@" sign (like "--attach @file.txt" or "--attach + @@file.txt"), but if you include a path to the file which splits up + the two "@" signs, that will work (eg "--attach @./@file.txt" will + include the contents of the file @file.txt). Sensitive If an option marked Sensitive attempts to prompt the user for an @@ -294,7 +298,13 @@ OPTION PROCESSING Setting a variable to an empty value is the same as specifying it on the command line with no argument. For instance, setting would cause Swaks to prompt the user for the - server to which to connect at each invocation. + server to which to connect at each invocation. On Windows, it is not + possible to set empty environment variables. The behavior can be + simulated by setting the environment variable to "<>" instead. + Additionally, embedding the header name in the header option via + environment variable is not allowed on Windows (eg + "SWAKS_OPT_header_Foo=bar" will result in an error, but + "SWAKS_OPT_header="Foo: bar"" will work.) Because there is no inherent order in options provided by setting environment variables, the options are sorted before being @@ -347,12 +357,14 @@ TRANSPORTS 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. + This transport requires the IO::Socket::IP module for both IPv4 and + IPv6 sockets. If this module is not loadable, Swaks will attempt to + use the IO::Socket library for IPv4 and IO::Socket::INET6 for IPv6 + support. Attempting to use this transport with none of those + libraries available will result in an error and program termination. - IPv6 is supported when the IO::Socket::INET6 module is present. + The fall back to IO::Socket and IO::Socket::INET6 is deprecated and + will be removed in a future release. See DEPRECATIONS below -s, --server [[:]] Explicitly tell Swaks to use network sockets and specify the @@ -365,8 +377,9 @@ TRANSPORTS 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) + IPv4 and IPv6 addresses). A port set via this option will only + be used if the "--port" option is not used. See also + "--copy-routing". (Arg-Required, From-Prompt) -p, --port [] Specify which TCP port on the target is to be used, or prompt if @@ -380,8 +393,9 @@ TRANSPORTS 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 : format. (Arg-Required, - From-Prompt) + additional comments on : format. A port set via this + option will only be used if the "--port" option is not used. + (Arg-Required, From-Prompt) -lp, --local-port, --lport [] Specify the outgoing port from which to originate the @@ -406,7 +420,7 @@ TRANSPORTS 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 + transport requires the IO::Socket::UNIX 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. @@ -446,17 +460,32 @@ PROTOCOL OPTIONS These options are related to the protocol layer. -t, --to [[,[,...]]] - 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. - + --cc [[,[,...]]] + --bcc [[,[,...]]] + These options all tell Swaks to use the argument(s) as the + envelope-recipient for the email. There are subtle differences + between these three options, detailed below. If any option is + specified but with no arguments, Swaks will prompt the user for an + argument. + + "--to" is special in that it is the only option required by Swaks. 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) + terminated before the recipient is needed. If multiple recipients + are provided and the recipient domain is needed to determine + routing, the domain of the last recipient in the "--to" argument + list is used. + + The primary distinction between these options is how their arguments + are treated when generating the DATA portion of the email. They each + have their own replacement tokens ("%TO_ADDRESS%", "%CC_ADDRESS%", + and "%BCC_ADDRESS%" respectively) which can be used by anyone + crafting a custom DATA. In Swaks' default message, "%TO_ADDRESS%" + will be used for the To: header and, if it is populated, + "%CC_HEADER%" will be used for a Cc: header. "%BCC_ADDRESS%" is not + used in the default DATA. (Arg-Required, From-Prompt) -f, --from [] Use argument as envelope-sender for email, or prompt user if no @@ -464,13 +493,14 @@ PROTOCOL OPTIONS 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) + determining the local-part varies. If the $LOGNAME environment + variable is set, it will be used as the local-part. Otherwise the + value from "Win32::LoginName()" will be used on Windows and + getpwuid(3) on UNIX-ish platforms. 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 [] String to use as argument to HELO/EHLO/LHLO command, or prompt user @@ -488,6 +518,11 @@ PROTOCOL OPTIONS "QUIT" and attempt to close the connection cleanly. These are the valid arguments and notes about their meaning. (Arg-Required) + PROXY + Quit after the server sends a response to a PROXY request. Note + that if there is not an error negotiating proxy, this will be + synonymous with CONNECT. + CONNECT, BANNER Terminate the session after receiving the greeting banner from the target. @@ -498,7 +533,18 @@ PROTOCOL OPTIONS transaction, behaves the same as HELO (see below). XCLIENT - Quit after XCLIENT is sent. + Quit after XCLIENT is negotiation. This always quits after the + point where XCLIENT would have been negotiated, regardless of + whether it was attempted. + + XCLIENT-HELO + Quit after the HELO that XCLIENT negotiation triggers. This + differs from HELO and FIRST-HELO because XCLIENT negotiation can + happen at multiple points in the SMTP transaction and it is + impossible to specifically refer to the XCLIENT-triggered HELO + using the HELO or FIRST-HELO stop-points. This always quits + after the point where the XCLIENT-triggered HELO would have + occurred, regardless of whether it was attempted. STARTTLS, TLS Quit the transaction immediately following TLS negotiation. Note @@ -529,15 +575,30 @@ PROTOCOL OPTIONS additionally accepts DATA and DOT, detailed below. (Arg-Required) DATA - Quit after DATA is sent. + Drop the connection after DATA is sent by server. - DOT Quit after the final '.' of the message is sent. + DOT Drop the connection after the final '.' of the message is sent + by server. --das, --drop-after-send 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) + same stop-points as "--drop-after". If the stop-point is for an + optional part of the transaction which is not actually sent (for + instance STARTTLS or AUTH), this option will behave identically to + "--drop-after". See below for specific details. (Arg-Required) + + CONNECT + Connect to the server and then drops the connection before + receiving the server's banner. + + STARTTLS, TLS + Behaves identically to "--drop-after". + + HELO, EHLO, LHLO + Doesn't necessarily work as expected. If it appears to read the + HELO response incorrectly, use FIRST-HELO instead. --timeout [