all repos — listfix @ c52c88c1c2b494010e94e37b32440b17a8d9d649

Postfix Mailing List Software; Maintained on behalf the of Agency Economy Incorporated NFP.

Check full recipient list for valid email addresses.
Also add all args to logging.

	modified:   listfix_filter.py
Brian Barto bartobrian@gmail.com
Wed, 16 Mar 2022 14:56:19 -0400
commit

c52c88c1c2b494010e94e37b32440b17a8d9d649

parent

bada9ddb1f3adf4b968556d72ee25aee7fe128c3

1 files changed, 15 insertions(+), 4 deletions(-)

jump to
M listfix_filter.pylistfix_filter.py

@@ -12,10 +12,11 @@ ########################

def args_ok(): if (len(sys.argv) > 2): - if (not re_email_arg.match(sys.argv[1]) or not re_email_arg.match(sys.argv[2])): - return False - else: - return True + for arg in sys.argv[1:]: + if (not re_email_arg.match(arg) or not re_email_arg.match(arg)): + return False + else: + return True else: return False

@@ -95,6 +96,14 @@

f.write("\n") f.close() +def log_line(line): + + line = line.rstrip() + + f = open("/tmp/listfix_log.txt", "a") + f.write(f"[Log Line] {line}\n") + f.close() + ######################## ## Main Program

@@ -145,6 +154,8 @@

## Logging if (logging): + for arg in sys.argv[1:]: + log_line(arg) log_info(sender, recipient, email) ## Check if this is an auto-reply