Spin transport in magnetic nanowires with domain walls