Diffraction effects, which occur when the fields in a beam waveguide are truncated at absorbing stops, can be conveniently analyzed using scattering-matrix theory applied to Gaussian-beam modes. We present recursion relationships for the elements of the scattering matrix when a nonaxially-symmetric beam illuminates an axially symmetric stop. We demonstrate the technique by calculating the total loss and beam profiles in a system comprising a diagonal horn, a lens, a window, and two off-axis mirrors. The finite size of each component is taken into account.