Refactoring: The MailGatewayFactory builds itself

This is a necessary step in order to reuse it in emailgateway.php as the
construction is quite complex and depends on the database.

Change-Id: I9c4e1f65ea929e8670498b49796d2b38130443e5
Merge commit 'refs/changes/87/2587/1' of ssh://gerrit.tuleap.net:29418/tuleap into HEAD

* ssh://gerrit.tuleap.net:29418/tuleap:
  Refactoring: The MailGatewayFactory builds itself

Change-Id: I7b5851cfb1c0d60e4b20555c977c3e93b81469fb
This is Tuleap 7.1.99.12

Change-Id: I4a3b29971783004b6a68d5179cb90d0c4699b5ad