Add email ticket handling.

This is not actually ready to be merged, I just want to view the
changes!