The First-principles calculation is used to investigate the transport properties of a carbon chain connected with N-and/or B-doped caped carbon nanotube acting as electrodes. The I-V curves of the carbon chain are affected by the N/B doping sites, and rectifying behavior can be obtained distinctly when the carbon chain is just connected onto two doping atom sites (N- chain-B), and a weak rectification occurs when N (B) doping at other sites. Interestingly, the spin-filtering effects exist in the junction when it is doped at other sites, undoped...