my $img = $ENV{QUERY_STRING};
if(defined $img and $img =~ /\S/) {
if($img =~ /^(\d+)-n$/) {
my $file = "$tmp_dir/$uri/mailgraph_$1.png";
graph($graphs[$1]{seconds}, $file);
send_image($file);
}
elsif($img =~ /^(\d+)-e$/) {
my $file = "$tmp_dir/$uri/mailgraph_$1_err.png";
graph_err($graphs[$1]{seconds}, $file);
send_image($file);
}
else {
die "ERROR: invalid argument\n";
}