I purchased a house last year that has cast iron drain lines. The inspector told me I should re-route the water softener drain line from the cast iron pipe to my sump pump. I happen to be on a ladder the other day and saw the top of the pipe where the softener discharge line is plumbed. The pipe is totally eroding away on the top. I checked the other pipes and they are fine,it's just the top of this 4' cast iron pipe that's rotted out. There is caulk all over the pipe on the top so I can asume the previous owner had aproblem. Two questions:

1. Is the softener discharge what caused the pipe to corrode ?2. What is the best fix ? (It's 4" cast Iron about 4 Ft long, One end inserts into a Y and the other end has a 22 degree elbow in it) Can I cut the wide part of the female Y off and the male part off the 22 off and use pvc with clamp boots ?