Migration of mail_environment

Migration and annual cleaning of the mail_environment module