The extracytoplasmic folding factor PrsA is required for protein secretion only in the presence of the cell wall in Bacillus subtilis.