potential sudo code for a handler of email requests