No insurer shall pay any claims (1) covering the loss, damage, or destruction to a building or other structure, amounting to one thousand dollars or more, or (2) covering any loss, damage or destruction of any amount, which causes the condition of a building or other structure to render section six of chapter one hundred and forty-three applicable, without having at least ten days previously given written notice to the building commissioner or inspector of buildings appointed pursuant to the state building code, to the fire department or arson squad of the city or town and to the board of health or board of selectmen of the city or town in which the same is located. If at any time prior to payment the said city or town notifies the insurer by certified mail of its intent to initiate proceedings designed to perfect a lien pursuant to section three A, or to section nine of chapter one hundred and forty-three, or section one hundred and twenty-seven B of chapter one hundred and eleven, the said payment shall not be made while the said proceedings are pending; provided, however, that said proceedings are initiated within thirty days of receipt of such notification.
Any lien perfected pursuant to section three A, or to section nine of chapter one hundred and forty-three or section one hundred and twenty-seven B of chapter one hundred and eleven, shall extend to and may be enforced by the city or town against any casualty insurance policy or policies covering any loss, damage, or destruction pursuant to which the proceedings to perfect the lien were initiated.
No insurer shall be liable to any insured owner, mortgagee, assignee, city or town, or other interested party for amounts disbursed to a city or town under the provisions of this section, or for amounts not disbursed to a city or town under the provisions of this section.
Mass. Gen. Laws ch. 139, § 3B