The length of the needle ending the Yersinia Ysc injectisome is determined by YscP, a protein acting as a molecular ruler. In addition, YscP is required for Yop secretion. In the present paper, by a systematic deletion analysis, we localized accurately the region required for Yop secretion between residues 405 and 500. As this C-terminal region of YscP has also been shown to control needle length it probably represents the substrate specificity switch of the machinery. By a bioinformatics analysis, we show that this region has a globular structure, an original alpha/beta fold, a P-x-L-G signature and presumably no catalytic activity. In spite of very limited sequence similarities, this structure is conserved among the proteins that are presumed to control the needle length in many different injectisomes and also among members of the FliK family, which control the flagellar hook length. This region thus represents a new protein domain that we called T3S4 for Type III secretion substrate specificity switch. The T3S4 domain of YscP can be replaced by the T3S4 domain of AscP (Aeromonas salmonicida) or PscP (Pseudomonas aeruginosa) but not by the one from FliK, indicating that in spite of a common global structure, these domains need to fit their partner proteins in the secretion apparatus.