move threads out of mail.rb since it works on any SIOC type