fitted Mediator and Session to the new mail code