Error 500 is most likely caused by file permissions.
The httpd user would need exe permissions mailgraph.cgi, and read permissions to .rrd files.
Allso a look in the logfile for that server will give you a good hint of what went wrong.
Make sure the first line in mailgraph.cgi points to the location of perl
Try do a :