We develop the formal density-functional theory of dipolar fluids allowing for bulk orientational (ferroelectric) order. The long-range character of the dipole–dipole interaction is treated by separating the direct correlation function of the fluid into short- and long-range parts. The contribution from the long-range part of the dipole–dipole interaction is shown to determine the energy of the macroscopic electric field, which depends on the sample shape and on boundary conditions. The short-range part of the direct correlation function can be used to calculate the regular contribution to the free energy, which is shape independent. An explanation is proposed for the failure of all existing density-functional theories to describe the behaviour of strongly dipolar fluids as observed in computer simulations.