Waxy crude oils are characterized by a large concentration of paraffin (a mixture of heavy hydrocarbons). For sufficiently low temperatures paraffin is partly crystallized and crystals tend to form a structure that is stable below some critical stress. The system can be modelled as a Bingham fluid with rheological parameters dependent on: (i) the fraction of crystallized paraffin, (ii) the aggregation degree of crystals. In previous papers various situations have been analysed for the flow of waxy crude crude oils in a loop in conditions such that all relevant quantities do not depend on the longitudinal coordinate along the pipe. The new factors here analysed are the paraffin deposition rate on the walls influencing the paraffin content in the flow and the boundary conditions, and the possibility of heat exchange with the medium that surrounds the pipe. This problem has two free boundaries: the boundary of the inner plug of the Bingham flow and the boundary of the solid paraffin layer at the wall. The mathematical model is formulated and well posedness is proved.