Diffractive parton distributions of the proton are determined from fits to diffractive data from HERA. In addition to the twist--2 contribution, the twist--4 contribution from longitudinally polarised virtual photons is considered, which is important in the region of small diffractive masses. A new prediction for the longitudinal diffractive structure function is presented which differs significantly from that obtained in the pure twist--2 analyses.