Trans leak from small metal cylinder

See the photo. My trans is happily leaking heaps of fluid from the area circled. The little cylinder, which is typically covered by the rotted rubber sleeve, is sliding in and out freely if I push or pull it. Fluid is dumping out from the joint of the black cable to the back our the cylinder as well as between the cylinder and the housing itself. Hopefully this makes sense.

Any ideas? Should the cylinder move in and out so easily? What should be sealing that isn't?

View attachment 1716149489

As mentioned above, it appears that the retaining pin was replaced with a bolt at some point? That could allow fluid travel along the threads.