From fd7feeccdcbeb477ff1b1735f12c505e0044f693 Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Sat, 20 Jun 2015 11:31:04 -0500 Subject: [PATCH] procmail-to-dispatch: get rid of key stuff key is now part of the URL, and the dispatcher action will choose whether or not to include it, so we don't need key at all anymore --- scripts/procmail-to-dispatch.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/procmail-to-dispatch.py b/scripts/procmail-to-dispatch.py index 2bc39f0..181d758 100644 --- a/scripts/procmail-to-dispatch.py +++ b/scripts/procmail-to-dispatch.py @@ -23,14 +23,13 @@ logger.setLevel(logging.DEBUG) # set up config flags parser = argparse.ArgumentParser() parser.add_argument('-f', '--filename') -parser.add_argument('-k', '--key') parser.add_argument('-l', '--location') parser.add_argument('-u', '--user') args = parser.parse_args() -if (args.filename == None or args.key == None or args.user == None or +if (args.filename == None or args.user == None or args.location == None): - print("script needs -f/--filename (location of .procmailrc.log) -k/--key (dispatch key to use) " + print("script needs -f/--filename (location of .procmailrc.log) " "-l/--location (url to connect to) -u/--user (user to authenticate to XML-RPC as)") sys.exit(2) @@ -111,7 +110,7 @@ while 1: if sender and subject: logger.debug("notifying: '{0:s}' from {1:s}".format(subject, sender)) - message = "[{0:s}] '{1:s}' from {2:s}".format(args.key, subject, sender) + message = "'{0:s}' from {1:s}".format(subject, sender) payload = {'message': message} r = requests.post(args.location, verify=False, auth=auth, data=payload) print(r.json())