work on the daemon for mailgraph

This commit is contained in:
John Supplee 2019-03-02 20:47:54 +02:00
parent d41cdb844c
commit 5ffa71999a
1 changed files with 12 additions and 3 deletions

View File

@ -526,12 +526,21 @@ def privacy_status_set():
@authorized_personnel_only
def mailgraph():
if request.query_string:
return utils.shell(
print("QUERY_STRING=%s" % request.query_string)
code, bin_out = utils.shell(
"check_output",
["/usr/share/mailgraph/mailgraph.cgi"],
env={"QUERY_STRING": request.query_string}
env={"QUERY_STRING": request.query_string},
return_bytes=True
)
return ''
if code != 0:
return ('Error generating mailgraph image: %s' % request.query_string, 500)
return make_response(bin_out)
return ('Mailgraph: no image requested', 500)
# MUNIN