The Casimir force between dissipative metallic mirrors at non zero temperature has recently given rise to contradictory claims which have raised doubts about the theoretical expression of the force. In order to contribute to the resolution of this difficulty, we come back to the derivation of the force from basic principles of the quantum theory of lossy optical cavities. We obtain an expression which is valid for arbitrary mirrors, including dissipative ones, characterized by frequency dependent reflection amplitudes.