Model scattering envelopes of young stellar objects. II - Infalling envelopes