[TASK] Deprecate/rewrite old mail functions