all repos — listfix @ 3770205c6c5e7febf23b092a86efecfe9442823d

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

Add lists command to dump lists defined in db.

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

3770205c6c5e7febf23b092a86efecfe9442823d

parent

37292302aef859c0657078e02b5d6f215f1da852

1 files changed, 12 insertions(+), 0 deletions(-)

jump to
M listfix_filter.pylistfix_filter.py

@@ -312,6 +312,14 @@ debug_line(3, f"List Recipient: {r}")

return True +def command_lists(): + + rows = db.execute("SELECT name, email FROM lists") + for row in rows: + print(f"{row[1]} ({row[0]})") + + return True + ######################## ## Main Program ########################

@@ -336,6 +344,10 @@ if (command == "filter"):

rval = command_filter() if (not rval): raise ValueError(f"Error while executing command_filter()") +elif (command == "lists"): + rval = command_lists() + if (not rval): + raise ValueError(f"Error while executing command_lists()") else: raise ValueError(f"Unknown Command: {command}")