all repos — listfix @ 37292302aef859c0657078e02b5d6f215f1da852

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

Removeargs_ok(). The command function can check it's own args.

	modified:   listfix_filter.py
Brian Barto bartobrian@gmail.com
Wed, 23 Mar 2022 15:55:43 -0400
commit

37292302aef859c0657078e02b5d6f215f1da852

parent

f94ae3e41903fd1f6804b5d72396b4f478ebcff3

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

jump to
M listfix_filter.pylistfix_filter.py

@@ -133,18 +133,6 @@ row = db.execute("select count(*) from sqlite_master where type = 'table' and name = 'recipients'").fetchone()

if (not row[0]): db.execute("create table recipients(id INTEGER primary key autoincrement, list_id int, name text, email text)") -def args_ok(command): - if (command == "filter"): - if (len(sys.argv) >= 4): - if (not re_email_arg.match(sys.argv[2]) or not re_email_arg.match(sys.argv[3])): - raise False - else: - return True - else: - raise False - else: - return False - def get_header(lines, header): rval = None

@@ -341,11 +329,6 @@ if (len(sys.argv) >= 1):

command = sys.argv[1] else: raise ValueError("Missing Command Argument") - -## Check Arguments - -if (not args_ok(command)): - raise ValueError(f"Missing or Invalid Arguments for Command: {command}") ## Evaluate command