various bug fixes for inbound email