  The cosmic microwave background (CMB) is gravitationally lensed by
large-scale structure, which distorts observations of the primordial
anisotropies in any given direction. Averaged over the sky, this important
effect is routinely modelled with the lensed CMB power spectra. This accounts
for the variance of this distortion, where the leading variance effect is
quadratic in the lensing deflections. However, we show that if bright
extragalactic sources correlated with the large-scale structure are masked in a
CMB map, the power spectrum measured over the unmasked area using a standard
pseudo-$C_\ell$ estimator has an additional~\emph{linear} lensing effect
arising from correlations between the masked area and the lensing. This induces
a scale-dependent average demagnification of the unlensed distance between
unmasked pairs of observed points and a negative contribution to the CMB
correlation function peaking at $\sim 10\,\arcmin$. We give simple analytic
models for point sources and a threshold mask constructed on a correlated
Gaussian foreground field. We demonstrate the consistency of their predictions
for masks removing radio sources and peaks of Sunyaev-Zeldovich and cosmic
infrared background emissions using realistic numerical simulations. We discuss
simple diagnostics that can be used to test for the effect in the absence of a
good model for the masked sources and show that by constructing specific masks
the effect can be observed on Planck data. For masks employed in the analysis
of Planck and other current data sets, the effect is likely to be negligible,
but may become an important subpercent correction for future surveys if
substantial populations of resolved sources are masked.
