Tomaz, the link Kabir provided shows an example of injecting a
SocketBinding service into a service that needs a socket and then using
that to create the socket. The SocketBinding service is created as a
result of a <socket-binding> element in domain.xml or standalone.xml.
The different thing about your mail service is the sockets involved are
not being opened on the AS itself; what your subsystem has is
configuration for a remote socket. The domain model doesn't currently
support including a <socket-binding> configuration for a remote socket;
that's the thing that would need to be added to tie it all together.