Optimal relay selection is investigated for secure cooperative communications against an adaptive eavesdropper that can perform eavesdropping if the eavesdropping link has good channel quality or perform jamming otherwise. A number of decode-and-forward relays are available for legitimate communications, among which one relay can be selected to help. For legitimate communications, three cases for availability of the eavesdropping channel information are considered: full channel knowledge, partial channel knowledge, and statistical channel knowledge. An optimal relay selection scheme is proposed for each case. For the first and third cases, exact secrecy outage probability expressions in closed form are derived, and for the second case, an approximate secrecy outage probability is derived, which is tight in the high main-to-eavesdropper ratio regime. Moreover, secrecy diversity order for the proposed relay selection scheme in each case is also derived, which is shown to be a full secrecy diversity. Finally, numerical results are given to verify the theoretical analysis derived in this paper.