  Quantum behavior of the electromagnetic field in unbounded macroscopic media
displaying absorption is properly described by the Langevin noise formalism
(macroscopic quantum electrodynamics) where the field is assumed to be entirely
produced by medium fluctuating sources via the dyadic Green's function. On the
other hand, such formalism is able to deal with the case of finite-size lossy
objects placed in vacuum only as a limiting situation where the permittivity
limit ${\rm Im} ( \varepsilon) \rightarrow 0^+$ pertaining the regions filled
by vacuum is taken at the end of the calculations. Strictly setting ${\rm Im} (
\varepsilon) =0$ is forbidden in the Langevin noise formalism since the field
would vanish in the lossless regions and this is physically due to the fact
that the contribution of the scattering modes to the field is not separated
from the contribution produced by the medium fluctuating sources. Recently, a
modified Langevin noise formalism has been proposed to encompass the scattering
modes and accordingly it is able to describe the structured lossless situations
by strictly setting ${\rm Im} (\varepsilon) = 0$. However such modified
formalism has been numerically validated only in few specific geometries. In
this paper we analytically derive the modified Langevin noise formalism from
the established canonical quantization of the electromagnetic field in
macroscopic media, thus proving that it models any possible scenario involving
linear, inhomegeneous and magnetodielectric samples. The derivation starts from
quantum Maxwell equations in the Heisenberg picture together with their formal
solution as the superposition of the medium assisted field and the scattering
modes. We analytically prove that each of the two field parts can be expressed
in term of particular bosonic operators, which in turn diagonalize the
electromagnetic Hamiltonian.
