Fix problem with no arguments

This is currently getting called with no arguments, and requires (as
stands) 2.  I'd handled the lack of 1 argument previously, but as of
getting further along the second argument is missing.
This commit is contained in:
Jigme Datse Yli-Rasku 2024-05-30 00:04:20 -07:00
parent ed07bec6e5
commit 7ac90e5d2a
2 changed files with 4 additions and 2 deletions

View File

@ -35,3 +35,4 @@ This is our current version trying to communicate between courier and mailman3.
* Hm, go with bare "Exception"... The catch wasn't what was failing.
* Let's try that instead?
* Oh man... Variable not properly defined (or more derferenced.)
* OK, it's failing further along, so maybe this works?

View File

@ -50,7 +50,8 @@ try:
# for qmail command docs and supplied environment variables.
# We need to replace "1" with an empty string, as qmail only supports EXT,
# EXT2, EXT3, EXT4.
arg_ext = sys.argv[2] if sys.argv[2] != "1" else ""
arg_ext_tmp = sys.argv[2] if len(sys.argv) > 2 else "1"
arg_ext = arg_ext_tmp if arg_ext_tmp != "1" else ""
lmtp.sendmail(
os.environ['SENDER'],
os.environ['EXT' + arg_ext] + "@" + os.environ['HOST'],