I was expecting something bent or broken when you got it open, not rusty sludge and no oil! Clean it out really good, I think you have a filter somewhere, change that. You might clean it and then run it for an hour with the rear wheels up in the air with the new oil and filter. Then, depending on how bad the new oil looks, do another oil change and filter. As expensive as the parts are, and how much effort it takes to get to them, burn the money on new oil and filters if you have any doubt.
Just reread your post; it shouldn't be leaking diesel out of the gearbox into the bell housing. You probably have a bad seal and that's where the oil leaked out. I think you pull the engine to get to the front of the tranny, not an easy job.