Fixed upgrade code not being executed
Merge branch 'mjulian/mail-upgrade-fix'