Reorganized mail configuration

Only for 3.2, I will do another pull request for 3.4