Feature/refactor mail connections

:octocat: