The Casimir effect with finite-mass photons