The motion of an air-fluid interface through an irregularly coated capillary is studied by analysing the Lucas-Washburn equation with a random capillary force. The pinning probability goes from zero to a maximum value, as the interface slows down. Under a critical velocity, the distribution of waiting times $tau$ displays a power-law tail $sim tau^{-2}$ which corresponds to a strongly intermittent dynamics, also observed in experiments. We elaborate a procedure to predict quantities of experimental interest, such as the average interface trajectory and the distribution of pinning lengths.