ported over the mail global config
Ported over email-ext test case