Devadahvagga

Suttapiṭaka · Majjhimanikāya · Vol. 14 · Section 17

[17] Endowed with this noble aggregate of virtue (sīlakkhandha), he experiences within himself a blameless happiness. On seeing a form with the eye, he does not grasp at the sign (nimitta) nor grasp at the secondary features (anubyañjana); since, were he to dwell with the eye faculty (cakkhundriya) unrestrained, evil, unwholesome states of covetousness and grief (abhijjhā-domanassa) might flow in upon him, he practises for its restraint; he guards the eye faculty; he attains restraint over the eye faculty. On hearing a sound with the ear … on smelling an odour with the nose … on tasting a flavour with the tongue … on touching a tangible with the body … on cognizing a mental phenomenon (dhamma) with the mind, he does not grasp at the sign nor grasp at the secondary features; since, were he to dwell with the mind faculty (manindriya) unrestrained, evil, unwholesome states of covetousness and grief might flow in upon him, he practises for its restraint; he guards the mind faculty; he attains restraint over the mind faculty.

English translation from the Pali (Siam Raṭṭha edition) — under review, not for citation.

This passage also appears in 1 other place