Section 17. An executor, administrator or trustee holding property subject to the tax imposed by this chapter shall deduct the tax therefrom or collect it from the legatee or person entitled to said property; and he shall not deliver property or a specific legacy subject to said tax until he has collected the tax thereon. An executor or administrator shall collect taxes due upon land passing by inheritance or will which is subject to said tax from the heirs or devisees entitled thereto, and he may be authorized to sell said land, in the manner prescribed by section twenty-one, if they refuse or neglect to pay said tax.