Reorganize SMTP types/functions