Spin-dependent conductivity of nanosized magnetic inhomogeneities