The logic in here is good, but with the comment about supports_* methods, you should check that the provider provides_mx, and that mx is also supported by the client. The supported check is implicit with the second part of this if because if it's not supported you shouldn't be able to enable the service in the first place, but I guess having an explicit check for support is good too.