1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2024-12-24 07:37:04 +00:00

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

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