Add pre and post migration scripts for mail

Reopened #14 PR against 8.0 instead of master