-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'use-arbitrary-arrays-in-getopt-parsing' into develop
* use-arbitrary-arrays-in-getopt-parsing: Error if argument to --timeout is in unexpected format Add script to find orphaned test reference files Fix command line reconstruction, no-arg options should not include an arg in reconstruction error if unidentified information found in option list Change Getopt option processing to use a custom list
- Loading branch information
Showing
333 changed files
with
345 additions
and
1,803 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,6 +111,8 @@ A message's body is the portion of its DATA section following the first blank li | |
|
||
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 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 no 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. | ||
|
@@ -131,8 +133,11 @@ A set of "portable" defaults can also be created by adding options to the end of | |
|
||
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 a 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. Here is an example of the contents of a configuration file: | ||
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 a 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] | ||
|
@@ -326,7 +331,7 @@ This option is similar to --drop-after, but instead of dropping the connection a | |
|
||
=item --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 or m (5s = 5 seconds, 3m = 180 seconds). As a special case, 0 means don't timeout the transactions. Default value is 30s. | ||
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. | ||
|
||
=item --protocol [protocol] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
auto: REMOVE_FILE,CREATE_FILE,MUNGE,COMPARE_FILE %TESTID%.stdout %TESTID%.stderr | ||
|
||
test action: CMD_CAPTURE %SWAKS% --dump --to [email protected] --server ser.ver --helo host1.nodns.test.swaks.net --from [email protected] --quit-after 'mail' --auth-user 'user' --auth-password 'pass' --tls '1' --hide-send '1' --dump --xclient-addr '192.168.0.4' --xclient-optional '1' --proxy-version '1' --proxy-family 'TCP4' --proxy-source '192.168.0.5' --proxy-source-port '111' --proxy-dest '1.1.1.1' --proxy-dest-port '26' | ||
test action: CMD_CAPTURE %SWAKS% --dump --to [email protected] --server ser.ver --helo host1.nodns.test.swaks.net --from [email protected] --quit-after 'mail' --auth-user 'user' --auth-password 'pass' --tls --hide-send --dump --xclient-addr '192.168.0.4' --xclient-optional --proxy-version '1' --proxy-family 'TCP4' --proxy-source '192.168.0.5' --proxy-source-port '111' --proxy-dest '1.1.1.1' --proxy-dest-port '26' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
App Info: | ||
X-Mailer = swaks v99999999.9 jetmore.org/john/code/swaks/ | ||
Cmd Line = %SWAKS_COMMAND% --from '[email protected]' --to '[email protected]' --helo 'host1.nodns.test.swaks.net' --server 'ser.ver' --quit-after 'mail' --auth-user 'user' --auth-password 'pass' --tls '1' --hide-send '1' --dump --xclient-addr '192.168.0.4' --xclient-optional '1' --proxy-version '1' --proxy-family 'TCP4' --proxy-source '192.168.0.5' --proxy-source-port '111' --proxy-dest '1.1.1.1' --proxy-dest-port '26' | ||
Cmd Line = %SWAKS_COMMAND% --from '[email protected]' --to '[email protected]' --helo 'host1.nodns.test.swaks.net' --server 'ser.ver' --quit-after 'mail' --auth-user 'user' --auth-password 'pass' --tls --hide-send --dump --xclient-addr '192.168.0.4' --xclient-optional --proxy-version '1' --proxy-family 'TCP4' --proxy-source '192.168.0.5' --proxy-source-port '111' --proxy-dest '1.1.1.1' --proxy-dest-port '26' | ||
|
||
Output Info: | ||
show_time_lapse = FALSE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
App Info: | ||
X-Mailer = swaks v99999999.9 jetmore.org/john/code/swaks/ | ||
Cmd Line = %SWAKS_COMMAND% --from '[email protected]' --to '[email protected]' --helo 'host1.nodns.test.swaks.net' --server 'ser.ver' --dump-as-body 'app,auth' --dump-as-body-shows-password '1' --auth-user 'TEST_USER' --auth-password 'TEST_PASS' --auth-hide-password 'CUSTOM_PASSWORD_REPLACEMENT' --dump 'app,auth,data' | ||
Cmd Line = %SWAKS_COMMAND% --from '[email protected]' --to '[email protected]' --helo 'host1.nodns.test.swaks.net' --server 'ser.ver' --dump-as-body 'app,auth' --dump-as-body-shows-password --auth-user 'TEST_USER' --auth-password 'TEST_PASS' --auth-hide-password 'CUSTOM_PASSWORD_REPLACEMENT' --dump 'app,auth,data' | ||
|
||
Authentication Info: | ||
auth = required | ||
|
@@ -28,7 +28,7 @@ X-Mailer: swaks v99999999.9 jetmore.org/john/code/swaks/ | |
|
||
App Info: | ||
X-Mailer = swaks v99999999.9 jetmore.org/john/code/swaks/ | ||
Cmd Line = %SWAKS_COMMAND% --from '[email protected]' --to '[email protected]' --helo 'host1.nodns.test.swaks.net' --server 'ser.ver' --dump-as-body 'app,auth' --dump-as-body-shows-password '1' --auth-user 'TEST_USER' --auth-password 'TEST_PASS' --auth-hide-password 'CUSTOM_PASSWORD_REPLACEMENT' --dump 'app,auth,data' | ||
Cmd Line = %SWAKS_COMMAND% --from '[email protected]' --to '[email protected]' --helo 'host1.nodns.test.swaks.net' --server 'ser.ver' --dump-as-body 'app,auth' --dump-as-body-shows-password --auth-user 'TEST_USER' --auth-password 'TEST_PASS' --auth-hide-password 'CUSTOM_PASSWORD_REPLACEMENT' --dump 'app,auth,data' | ||
|
||
Authentication Info: | ||
auth = required | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,6 @@ auto: REMOVE_FILE,CREATE_FILE,MUNGE,COMPARE_FILE %TESTID%.stdout %TESTID%.stderr | |
|
||
title: apt, config, no-option | ||
|
||
pre action: MERGE %OUTDIR%/swaksrc-%TESTID% string:'apt \nno-apt' | ||
pre action: MERGE %OUTDIR%/swaksrc-%TESTID% string:'apt\nno-apt' | ||
test action: CMD_CAPTURE %SWAKS% --dump AUTH --to [email protected] --from [email protected] --helo hserver --server "ser.ver" --au USER --ap PASS \ | ||
--config %OUTDIR%/swaksrc-%TESTID% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,6 @@ auto: REMOVE_FILE,CREATE_FILE,MUNGE,COMPARE_FILE %TESTID%.stdout %TESTID%.stderr | |
|
||
title: auth-plaintext, config, no-option | ||
|
||
pre action: MERGE %OUTDIR%/swaksrc-%TESTID% string:'auth-plaintext \nno-auth-plaintext' | ||
pre action: MERGE %OUTDIR%/swaksrc-%TESTID% string:'auth-plaintext\nno-auth-plaintext' | ||
test action: CMD_CAPTURE %SWAKS% --dump AUTH --to [email protected] --from [email protected] --helo hserver --server "ser.ver" --au USER --ap PASS \ | ||
--config %OUTDIR%/swaksrc-%TESTID% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ auto: REMOVE_FILE,CREATE_FILE,MUNGE,COMPARE_FILE %TESTID%.stdout %TESTID%.stderr | |
title: dabsp, command line, no-option | ||
|
||
test action: CMD_CAPTURE %SWAKS% --dump DATA --to [email protected] --from [email protected] --helo hserver --server "ser.ver" --au auth_user --ap auth_pass --dab AUTH \ | ||
--dabsp '' --no-dabsp | ||
--dabsp --no-dabsp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,6 @@ auto: REMOVE_FILE,CREATE_FILE,MUNGE,COMPARE_FILE %TESTID%.stdout %TESTID%.stderr | |
|
||
title: dabsp, config, no-option | ||
|
||
pre action: MERGE %OUTDIR%/swaksrc-%TESTID% string:'dabsp \nno-dabsp' | ||
pre action: MERGE %OUTDIR%/swaksrc-%TESTID% string:'dabsp\nno-dabsp' | ||
test action: CMD_CAPTURE %SWAKS% --dump DATA --to [email protected] --from [email protected] --helo hserver --server "ser.ver" --au auth_user --ap auth_pass --dab AUTH \ | ||
--config %OUTDIR%/swaksrc-%TESTID% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ auto: REMOVE_FILE,CREATE_FILE,MUNGE,COMPARE_FILE %TESTID%.stdout %TESTID%.stderr | |
title: dump-as-body-shows-password, command line, no-option | ||
|
||
test action: CMD_CAPTURE %SWAKS% --dump DATA --to [email protected] --from [email protected] --helo hserver --server "ser.ver" --au auth_user --ap auth_pass --dab AUTH \ | ||
--dump-as-body-shows-password '' --no-dump-as-body-shows-password | ||
--dump-as-body-shows-password --no-dump-as-body-shows-password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,6 @@ auto: REMOVE_FILE,CREATE_FILE,MUNGE,COMPARE_FILE %TESTID%.stdout %TESTID%.stderr | |
|
||
title: dump-as-body-shows-password, config, no-option | ||
|
||
pre action: MERGE %OUTDIR%/swaksrc-%TESTID% string:'dump-as-body-shows-password \nno-dump-as-body-shows-password' | ||
pre action: MERGE %OUTDIR%/swaksrc-%TESTID% string:'dump-as-body-shows-password\nno-dump-as-body-shows-password' | ||
test action: CMD_CAPTURE %SWAKS% --dump DATA --to [email protected] --from [email protected] --helo hserver --server "ser.ver" --au auth_user --ap auth_pass --dab AUTH \ | ||
--config %OUTDIR%/swaksrc-%TESTID% |
Oops, something went wrong.