Fixes: During a migration, certain scenarios could result in the deletion of the only existing copy of an email without anyone noticing (the migration would still complete "successfully").
Fixed the file traversal mechanism used, in particular, during data migrations, which could previously enter an infinite loop or duplicate emails in certain cases.