Any railroad corporation may, upon giving notice as herein provided, enter upon unimproved land adjoining any location or right of way upon which it operates engines burning wood, coke or coal, and may there, at its own expense and subject to the direction of the forest warden, or the officer or board having his powers, in the city or town where the land lies, clear such land of dead leaves, dead grass and dead wood to a distance of one hundred feet from the tracks, without thereby becoming liable for trespass; provided, that no railroad corporation shall, under this section, do any acts on unimproved land outside its location or right of way, unless it has within two months given fourteen days' written notice by mail or otherwise to the occupant of the land, and to the owner thereof, if he resides or has a usual place of business in the city or town where it lies, and if the land is unoccupied and the owner does not reside or have a usual place of business in the city or town, then, unless the railroad corporation has within two months published notice of its purpose once in three successive weeks in a newspaper published in the county where the land lies, and unless it has within three days given at least twenty-four hours' notice to the forest warden, or the officer or board having his powers, in the city or town where the land lies of the location of the land which it intends to enter under this section, and of the time at which it intends to enter the same; and provided, further, that no notice hereby required shall be valid unless it sets forth the provisions of this section.
Mass. Gen. Laws ch. 160, § 236