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
This commit is contained in:
Brian S. Stephan 2015-06-20 11:31:04 -05:00
parent 598a158300
commit fd7feeccdc

View File

@ -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())