Skip to content

Commit

Permalink
Changes for 20201014.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
jetmore committed Oct 14, 2020
1 parent ba4713d commit 0011eb0
Show file tree
Hide file tree
Showing 13 changed files with 135 additions and 58 deletions.
5 changes: 5 additions & 0 deletions App-swaks/Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Revision history for Perl extension App::swaks.

20201014.0 Web Oct 14 17:00:00 2020
- tracking Swaks release 20201014.0. See
http://jetmore.org/john/code/swaks/versions.html
for full details.

20201010.0 Sat Oct 10 17:15:00 2020
- tracking Swaks release 20201010.0. See
http://jetmore.org/john/code/swaks/versions.html
Expand Down
2 changes: 1 addition & 1 deletion App-swaks/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use ExtUtils::MakeMaker;
# the contents of the Makefile that is written.
WriteMakefile(
NAME => 'App::swaks',
VERSION => '20201010.0',
VERSION => '20201014.0',
ABSTRACT => 'Swiss Army Knife for SMTP testing',
AUTHOR => 'John Jetmore <[email protected]>',
LICENSE => 'gpl',
Expand Down
2 changes: 1 addition & 1 deletion App-swaks/README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
App-swaks version 20201010.0
App-swaks version 20201014.0
======================

App::swaks is a perl package which distributes the Swaks SMTP test
Expand Down
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -928,3 +928,4 @@
* 20201014 Fix --protect-prompt. Not implemented correctly after option
processing overhaul in a46b929 #26
* 20201014 Add newline echo after entering password with --protect-prompt
> 20201014 released 20201014.0
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The official project page is <https://jetmore.org/john/code/swaks/>.

## Download

The latest version of Swaks is **20201010.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 **20201014.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.

Expand Down Expand Up @@ -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-20201010-0-available/
[release_package]: https://jetmore.org/john/code/swaks/files/swaks-20201010.0.tar.gz
[release_script]: https://jetmore.org/john/code/swaks/files/swaks-20201010.0/swaks
[rendered_doc]: https://github.com/jetmore/swaks/blob/v20201010.0/doc/base.pod
[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
35 changes: 10 additions & 25 deletions RELEASE/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ Check the following files
The text version of the --help output
doc/Changes.txt
All changes to Swaks
doc/installation.txt
Notes on installing Swaks
doc/recipes.txt
Hints, tips, tricks that don't fit in the reference

Expand Down Expand Up @@ -90,29 +88,16 @@ A full copy of this license should be available in the LICENSE.txt file.
------------------------------
Change Summary
------------------------------
v20201010
v20201014.0
New Features:
* Added .netrc support
* Added --tls-sni option
* Swaks is now available on CPAN as App::swaks
* Swaks will now print errors if deprecated functionality is used
* None
Notable Changes:
* Automatic file detection is deprecated. Previously, if an argument to
--data, --body, --attach-body, and --attach resolved to an openable file,
the contents of that file would be used as the actual argument. Now the
proper way to do this is to place '@' in front of the argument to
state explicitly that the argument contents are in a file.
* If any of the --xclient-* family of options (--xclient-name,
--xclient-addr, etc) is provided more than once, only the last option
provided will be used. See --xclient option if you need to simulate
the previous behavior
* -g option is now deprecated
* Time::Local is no longer used and POSIX is now listed as a required
module
* None
Notable Bugs Fixed:
* Fix for subtle issue related to environment variable options. Affected
error handling for options which required args.
* Fix issue preventing XCLIENT and STARTTLS from working together
properly (#21)
* Fix issue which could cause generated date header to oscillate on
the day of DST transition (#17, deb bug 955798)
* 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)
8 changes: 8 additions & 0 deletions RELEASE/doc/Changes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
> 20201014 released 20201014.0
* 20201014 Add newline echo after entering password with --protect-prompt
* 20201014 Fix --protect-prompt. Not implemented correctly after option
processing overhaul in a46b929 #26
* 20201013 But actually fix the date string this time. Also fix #25
* 20201012 Fix date string - should always be in English, not localized
(introduced in 434f494abcc3558c73efc0e57a4338adeb402253)
* 20201011 Fix test scripts to munge copyright date
> 20201010 released 20201010.0
* 20201010 Package App::swaks-20190914.0 for CPAN distribution (#23)
* 20201004 Convert installation.pod to installation.html, link to it from
Expand Down
15 changes: 12 additions & 3 deletions RELEASE/doc/ref.txt
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@ OPTION PROCESSING
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
Expand Down Expand Up @@ -837,7 +844,7 @@ AUTHENTICATION
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)
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
Expand Down Expand Up @@ -1394,8 +1401,10 @@ OUTPUT OPTIONS

-pp, --protect-prompt
Don't echo user input on prompts that are potentially sensitive
(right now only authentication password). See also
"--auth-hide-password". (Arg-None)
(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
Expand Down
37 changes: 27 additions & 10 deletions RELEASE/swaks
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use strict;

$| = 1;
my($p_name) = $0 =~ m|/?([^/]+)$|;
my $p_version = build_version("20201010.0", '$Id$');
my $p_version = build_version("20201014.0", '$Id$');
my $p_usage = "Usage: $p_name [--help|--version] (see --help for details)";
my $p_cp = <<'EOM';
Copyright (c) 2003-2008,2010-2020 John Jetmore <[email protected]>
Expand Down Expand Up @@ -1408,6 +1408,7 @@ sub interact {
#local $SIG{INT} = sub { ReadMode('restore'); };
chomp($response = <STDIN>);
ReadMode('restore');
print "\n";
} else {
$G::interact_method ||= "default";
chomp($response = <STDIN>);
Expand All @@ -1431,13 +1432,15 @@ sub interact {
}
}
ReadMode('restore');
print "\n";
$response = join('', @resp);
} elsif ($G::interact_method eq "unix-stty" || (!$G::interact_method && open(STTY, "stty -a |"))) {
$G::interact_method ||= "unix-stty";
{ my $foo = join('', <STTY>); }
system('stty', '-echo');
chomp($response = <STDIN>);
system('stty', 'echo');
print "\n";
} else {
$G::interact_method ||= "default";
chomp($response = <STDIN>);
Expand Down Expand Up @@ -1667,6 +1670,7 @@ sub get_option_struct {
OP_FROM_PROMPT => 0x08, # option prompts for an argument if none provided
OP_FROM_FILE => 0x10, # option treats arg of '-' to mean 'read from stdin' (no prompt)
OP_DEPRECATED => 0x20, # This option is deprecated
OP_SENSITIVE => 0x40, # indicates that if prompted for, the argument should be masked (see --protect-prompt)
};

@G::raw_option_data = (
Expand Down Expand Up @@ -1761,7 +1765,7 @@ sub get_option_struct {
okey => 'auth_user', type => 'scalar', },
# pass for auth
{ opts => ['auth-password', 'ap'], suffix => ':s',
cfgs => OP_ARG_OPT, # we dynamically change this later
cfgs => OP_ARG_OPT|OP_SENSITIVE, # we dynamically change this later
okey => 'auth_pass', type => 'scalar', },
# auth type map
{ opts => ['auth-map', 'am'], suffix => '=s',
Expand Down Expand Up @@ -2532,7 +2536,7 @@ sub get_arg {
ptrans(12, "Internal option processing error: option $argExt->{opt} missing required match key (this is a swaks bug)");
exit(1);
}
$return = interact($optConfig->{prompt}, $optConfig->{match});
$return = interact($optConfig->{prompt}, $optConfig->{match}, $optConfig->{cfgs} & OP_SENSITIVE);
}
# No arg, no request to prompt - this is an error since we're requiring an arg
else {
Expand Down Expand Up @@ -3444,7 +3448,7 @@ sub process_args {

$auth_pass_t ||= obtain_from_netrc('password', $n{a_user});
if (!$auth_pass_t) {
my $cfg = { cfgs => OP_ARG_REQ|OP_FROM_PROMPT, prompt => 'Password: ', match => 'SKIP', okey => 'auth_pass', akey => 'auth_pass' };
my $cfg = { cfgs => OP_ARG_REQ|OP_FROM_PROMPT|OP_SENSITIVE, prompt => 'Password: ', match => 'SKIP', okey => 'auth_pass', akey => 'auth_pass' };
$auth_pass_t = get_arg('auth_pass', $o, $cfg, 1);
}
$n{a_pass} = $auth_pass_t eq '<>' ? '' : $auth_pass_t;
Expand Down Expand Up @@ -3742,19 +3746,28 @@ sub get_username {
sub get_date_string {
return($G::date_string) if (length($G::date_string) > 0);

my $et = time();
my $et = time();
my @month_names = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
my @day_names = qw(Sun Mon Tue Wed Thu Fri Sat);

if (!avail("date_manip")) {
ptrans(12, avail_str("date_manip").". Date strings will be in GMT");
my @l = gmtime($et);
$G::date_string = sprintf("%s, %02d %s %d %02d:%02d:%02d %+05d",
(qw(Sun Mon Tue Wed Thu Fri Sat))[$l[6]],
$day_names[$l[6]],
$l[3],
(qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec))[$l[4]],
$month_names[$l[4]],
$l[5]+1900, $l[2], $l[1], $l[0],
0);
} else {
$G::date_string = POSIX::strftime("%a, %d %b %Y %H:%M:%S %z", localtime($et));
# this is convoluted because %a (week day name) and %b (month name) are localized, but per RFC they should be in English. Since
# un-localizing didn't work on every system I tested, jump through hoops here to not use those fields at all.
my @l = localtime($et);
$G::date_string = sprintf("%s, %s %s %s",
$day_names[POSIX::strftime("%w", @l)],
POSIX::strftime("%d", @l),
$month_names[POSIX::strftime("%m", @l) - 1],
POSIX::strftime("%Y %H:%M:%S %z", @l));
}
return($G::date_string);
}
Expand Down Expand Up @@ -3981,6 +3994,10 @@ If the initial argument is C<->, the final argument is the contents of C<STDIN>.
If the initial argument is prefixed with C<@>, 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 C<@>, use two C<@> symbols. The first will be stripped.
=item Sensitive
If an option marked Sensitive attempts to prompt the user for an argument and the C<--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.
=item Deprecated
An option labeled Deprecated has been officially deprecated and will be removed in a future release. See the L</DEPRECATIONS> section of this documentation for details about the deprecations.
Expand Down Expand Up @@ -4397,7 +4414,7 @@ Provide the username to be used for authentication. If no username is provided,
=item -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 F<.netrc> (requires the L<Net::Netrc> module). If no password is provided and cannot be found via F<.netrc>, the user will be prompted to provide one. The string C<< <> >> can be supplied to mean an empty password. (Arg-Required, From-Prompt)
Provide the password to be used for authentication. If no password is provided, indicate that Swaks should attempt to find the password via F<.netrc> (requires the L<Net::Netrc> module). If no password is provided and cannot be found via F<.netrc>, the user will be prompted to provide one. The string C<< <> >> can be supplied to mean an empty password. (Arg-Required, From-Prompt, Sensitive)
=item -ae, --auth-extra <key-value-pair>[,<key-value-pair>[,...]]
Expand Down Expand Up @@ -4771,7 +4788,7 @@ These options allow the user to send output to files instead of C<STDOUT>/C<STDE
=item -pp, --protect-prompt
Don't echo user input on prompts that are potentially sensitive (right now only authentication password). See also C<--auth-hide-password>. (Arg-None)
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 C<--auth-hide-password>. (Arg-None)
=item -hr, --hide-receive
Expand Down
4 changes: 2 additions & 2 deletions doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h4>About</h4>
<div class="row">
<h4>Download</h4>
<p>
The latest version of Swaks is <b>20201010.0</b> (<a href="https://www.jetmore.org/john/blog/2020/10/swaks-release-20201010-0-available/">announcement</a>), which can be downloaded as a <a href="files/swaks-20201010.0.tar.gz">package</a> or a <a href="files/swaks-20201010.0/swaks">standalone script</a>.
The latest version of Swaks is <b>20201014.0</b> (<a href="https://www.jetmore.org/john/blog/2020/10/swaks-release-20201014-0-available/">announcement</a>), which can be downloaded as a <a href="files/swaks-20201014.0.tar.gz">package</a> or a <a href="files/swaks-20201014.0/swaks">standalone script</a>.
</p>
<p>
See the <a href="installation.html">installation page</a> for details on installing in multiple environments.
Expand All @@ -67,7 +67,7 @@ <h4>Download</h4>
<h4>Documentation</h4>
<p>
The reference documentation from the latest release,
which includes quick-start examples, is available as <a href="latest/doc/ref.txt">plain text</a> and <a href="https://github.com/jetmore/swaks/blob/v20201010.0/doc/base.pod">rendered</a>.
which includes quick-start examples, is available as <a href="latest/doc/ref.txt">plain text</a> and <a href="https://github.com/jetmore/swaks/blob/v20201014.0/doc/base.pod">rendered</a>.
The documentation from each release is available from the <a href="versions.html">versions page</a>.
There is also an <a href="faq.html">Occasionally Asked Questions</a> document.
</p>
Expand Down
12 changes: 6 additions & 6 deletions doc/installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,21 @@ <h6>Unpackaged</h6>
This method just downloads the script itself. No documentation is included.
</p>
<pre><code>
curl -O https://jetmore.org/john/code/swaks/files/swaks-20201010.0/swaks
curl -O https://jetmore.org/john/code/swaks/files/swaks-20201014.0/swaks
chmod 755 ./swaks
</code></pre>
<h6>Packaged</h6>
<p>
This method downloads the release package, which includes documentation.
</p>
<pre><code>
curl -O https://jetmore.org/john/code/swaks/files/swaks-20201010.0.tar.gz
tar -xvzf swaks-20201010.0.tar.gz
chmod 755 ./swaks-20201010.0/swaks
curl -O https://jetmore.org/john/code/swaks/files/swaks-20201014.0.tar.gz
tar -xvzf swaks-20201014.0.tar.gz
chmod 755 ./swaks-20201014.0/swaks
</code></pre>
<h6>CPAN</h6>
<p>
Swaks is on CPAN as <a href=https://metacpan.org/release/JETM/App-swaks-20201010.0>App::swaks</a>. Any of the standard Perl tools can be used to download and install the package. The primary advantage of using the CPAN distribution is that it provides ease of installation on operating systems which do not otherwise package Swaks, including Windows.
Swaks is on CPAN as <a href=https://metacpan.org/release/JETM/App-swaks-20201014.0>App::swaks</a>. Any of the standard Perl tools can be used to download and install the package. The primary advantage of using the CPAN distribution is that it provides ease of installation on operating systems which do not otherwise package Swaks, including Windows.
</p>
<pre><code>
# use CPAN
Expand Down Expand Up @@ -126,7 +126,7 @@ <h5>BSD</h5>
<h5>Windows</h5>
<p>
There's no packaged version in Windows. The easiest way to install in Windows is to use the CPAN-packaged
<a href=https://metacpan.org/release/JETM/App-swaks-20201010.0>App::swaks</a>.
<a href=https://metacpan.org/release/JETM/App-swaks-20201014.0>App::swaks</a>.
Keep in mind that a working Perl will need to be installed (<a href='http://strawberryperl.com/'>Strawberry Perl</a> and
<a href='https://www.activestate.com/products/perl/'>ActiveState Perl</a> both work)
</p>
Expand Down
Loading

0 comments on commit 0011eb0

Please sign in to comment.