Upgrade mail dependency to 2.5.2

Backport of b18fc59d28d96ba4d3481a71030b56f643653f3c from 3-2-stable branch