Electrocoagulation for sulfate removal