The well-known formula for the final size of an epidemic was published by Kermack and McKendrick in 1927. Their analysis was based on a simple susceptible-infected-recovered (SIR) model that assumes exponentially distributed infectious periods. More recent analyses have established that the standard final size formula is valid regardless of the distribution of infectious periods, but that it fails to be correct in the presence of certain kinds of heterogeneous mixing (e.g., if there is a core group, as for sexually transmitted diseases). We review previous work and establish more general conditions under which Kermack and McKendrick's formula is valid. We show that the final size formula is unchanged if there is a latent stage, any number of distinct infectious stages and/or a stage during which infectives are isolated (the durations of each stage can be drawn from any integrable distribution). We also consider the possibility that the transmission rates of infectious individuals are arbitrarily distributed--allowing, in particular, for the existence of super-spreaders--and prove that this potential complexity has no impact on the final size formula. Finally, we show that the final size formula is unchanged even for a general class of spatial contact structures. We conclude that whenever a new respiratory pathogen emerges, an estimate of the expected magnitude of the epidemic can be made as soon the basic reproduction number R0 can be approximated, and this estimate is likely to be improved only by more accurate estimates of R0, not by knowledge of any other epidemiological details.