Abstract.A new method will be introduced for the derivation of thermodynamically consistent boundary conditions for the full Cahn-Hilliard-Navier-Stokes-Fourier system for two immiscible fluids, where the phase field variable (order parameter) is given in terms of concentrations or partial densities. Five different types of models will be presented and discussed. The article can be considered as a continuation of a previous work by Heida, Málek and Rajagopal [16], which focused on the derivation and generalization of Cahn-HilliardNavier-Stokes models. The method is based on the assumption of maximum rate of entropy production by Rajagopal and Srinivasa [30]. This assumption will be generalized to surfaces of bounded domains using an integral formulation of the balance of entropy. Following [30], the calculations are based on constitutive equations for the bulk energy, the surface energy and the rates of entropy production in the bulk and on the surface. The resulting set of boundary conditions will consist of dynamic boundary conditions for the Cahn-Hilliard equation and either generalized Navier-slip, perfect slip or no-slip boundary conditions for the balance of linear momentum. Additionally, we will find that we also have to impose a boundary condition on the normal derivative of the normal component of the velocity field. The new approach has the advantage that the calculations are very transparent, the resulting equations come up very naturally and it is obvious how the calculations can be generalized to more than two fluids or more general constitutive assumptions for the energies. Additionally to former approaches, the approach also yields the full balance of energy for thewhole system. Finally, a possible explanation will be given for the "rolling" movement of the contact line, first observed in Dussan and Davis [8].