all repos — listfix @ 1da4175604a52d04176e76a70c67efa998168a70

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

Minor code cleanup for the filter command.

	modified:   listfix.py
Brian Barto bartobrian@gmail.com
Wed, 30 Mar 2022 11:19:35 -0400
commit

1da4175604a52d04176e76a70c67efa998168a70

parent

0e943ae4fe1b3ee4c74d5a03b1a668dca79b127f

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

jump to
M listfix.pylistfix.py

@@ -45,24 +45,19 @@ ## Evaluate command

if (command == "filter"): list_email = args.get_list_email() + list_name = db.get_list_name(list_email) + list_recipients = db.get_list_recipients(list_email) - content = list(sys.stdin)[:] - - email_in = Email(content) - + email_in = Email(list(sys.stdin)) if (email_in.is_auto_reply()): exit() - sender_email = email_in.get_sender_email() sender_name = email_in.get_sender_name() - list_name = db.get_list_name(list_email) - list_recipients = db.get_list_recipients(list_email) - email_out = Email(email_in.get_content()) email_out.strip_headers(exclude = ["To", "Cc", "Subject", "Content-[^:]+", "MIME-Version"]) if (sender_email not in list_recipients): - email_out.add_header_prepend(f"Reply-To: {list_email}, {sender}") + email_out.add_header_prepend(f"Reply-To: {list_email}, {sender_email}") else: email_out.add_header_prepend(f"Reply-To: {list_email}") email_out.add_header_prepend(f"From: \"{sender_name} via {list_name}\" <{list_email}>")