[T7189] fix ir.mail_server functions, add dependencies and permissions.

Merged Joel Maglioni requested to merge T7189 into 17.0-stage

Merge request reports