diff --git a/docs/courier-to-mailman3.md b/docs/courier-to-mailman3.md index d068fa5..5fbe6c1 100644 --- a/docs/courier-to-mailman3.md +++ b/docs/courier-to-mailman3.md @@ -34,4 +34,5 @@ This is our current version trying to communicate between courier and mailman3. * Catch exception, log based on that? * 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.) \ No newline at end of file +* Oh man... Variable not properly defined (or more derferenced.) +* OK, it's failing further along, so maybe this works? \ No newline at end of file diff --git a/source/courier-to-mailman3.py b/source/courier-to-mailman3.py index f0f74ac..58a0eac 100644 --- a/source/courier-to-mailman3.py +++ b/source/courier-to-mailman3.py @@ -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'],