all repos — listfix @ f95410f718f8ff824a1d09c007444e8d3f499e53

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

Change recipient to an array of recipients.

	modified:   listfix_filter.py
Brian Barto bartobrian@gmail.com
Wed, 16 Mar 2022 16:13:06 -0400
commit

f95410f718f8ff824a1d09c007444e8d3f499e53

parent

c52c88c1c2b494010e94e37b32440b17a8d9d649

1 files changed, 8 insertions(+), 5 deletions(-)

jump to
M listfix_filter.pylistfix_filter.py

@@ -81,11 +81,13 @@ for line in email_contents:

p.write(line) p.close() -def log_info(sender, recipient, lines): +def log_info(sender, recipients, lines): f = open("/tmp/listfix_log.txt", "a") f.write(f"Postfix Sender: {sender}\n") - f.write(f"Postfix Recipient: {recipient}\n") + + for recipient in recipients: + f.write(f"Postfix Recipient: {recipient}\n") for line in lines: if (re_header_end.match(line)):

@@ -125,7 +127,7 @@ fqdn = socket.getfqdn()

username = pwd.getpwuid(os.getuid())[0] sender = None -recipient = None +recipients = [] to_line = None from_line = None sender_name = None

@@ -140,7 +142,8 @@ ## Get/check args

if (args_ok()): sender = sys.argv[1] - recipient = sys.argv[2] + for arg in sys.argv[2:]: + recipients.append(arg) else: raise ValueError('Missing or Invalid Arguments')

@@ -156,7 +159,7 @@

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