The income received by trustees or other fiduciaries shall be taxed in the following manner:
(a)The income received by trustees or other fiduciaries described in subsection (c) of this section shall be subject to the taxes imposed by this chapter to the extent that the persons to whom the same is payable, or for whose benefit it is accumulated, are inhabitants of the commonwealth; provided, however, if the income received by such trustees or other fiduciaries would be subject to taxation under section five A if received by a nonresident, such income shall be taxable regardless of whether the persons to whom the income from the trust is payable or for whose benefit it is accumulated are residents or nonresidents of the commonwealth. Income received by trustees or other fiduciaries described in subsection (c) of this section which is accumulated for unborn or unascertained persons, or persons with uncertain interests shall be taxed as if accumulated for the benefit of a known inhabitant of the commonwealth. For the purposes of this section and of section nine income shall be deemed to be accumulated for unborn or unascertained persons or persons with uncertain interests when thus accumulated by estates, by trustees or other fiduciaries, who are subject to the provisions of this section or of section nine, for the benefit of any future interest other than a remainder presently vested in a person or persons in being not subject to be divested by the happening of any contingency expressly mentioned in the instrument creating the trust.
No person shall be taxed under this chapter for income received from any trustee or other fiduciary, which income has itself been taxed under this section.