From 9d874c545a77988f06beaeb8f4264c3f749d7245 Mon Sep 17 00:00:00 2001 From: Jigme Datse Yli-Rasku Date: Thu, 30 May 2024 00:25:10 -0700 Subject: [PATCH] Logging environment variables --- docs/courier-to-mailman3.md | 3 ++- source/courier-to-mailman3.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/courier-to-mailman3.md b/docs/courier-to-mailman3.md index 51c6f4a..57b406d 100644 --- a/docs/courier-to-mailman3.md +++ b/docs/courier-to-mailman3.md @@ -37,4 +37,5 @@ This is our current version trying to communicate between courier and mailman3. * Oh man... Variable not properly defined (or more derferenced.) * OK, it's failing further along, so maybe this works? * I see... - * The parsing of the environment variables is failing, but let's try this. \ No newline at end of file + * The parsing of the environment variables is failing, but let's try this. +* That's not doing it... Might need to create users? \ No newline at end of file diff --git a/source/courier-to-mailman3.py b/source/courier-to-mailman3.py index 50c9a06..8af5c3e 100644 --- a/source/courier-to-mailman3.py +++ b/source/courier-to-mailman3.py @@ -50,6 +50,12 @@ 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. + logger.info('User: %s', os.environ['USER']) + logger.info('EXT: %s', os.environ['EXT']) + logger.info('EXT4: %s', os.environ['EXT2']) + logger.info('EXT3: %s', os.environ['EXT3']) + logger.info('EXT2: %s', os.environ['EXT4']) + logger.info('DEFAULT: %s', os.enviorn['DEFAULT']) 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(