Whenever a tenancy at will of premises occupied for dwelling purposes, other than a room or rooms in a hotel, is terminated, without fault of the tenant, either by operation of law or by act of the landlord, except as provided in section twelve, no action to recover possession of the premises shall be brought, nor shall the tenant be dispossessed, until after the expiration of a period, equal to the interval between the days on which the rent reserved is payable or thirty days, whichever is longer, from the time when the tenant receives notice in writing of such termination; but such tenant shall be liable to pay rent for such time during the said period as he occupies or retains the premises, at the same rate as theretofore payable by him while a tenant at will; provided, that in the case of a rooming house, an action to recover possession of premises occupied for dwelling purposes may be brought seven days after written notice if the rent is payable on either a weekly or daily basis. A tenancy at will of property occupied for dwelling purposes shall not be terminated by operation of law by the conveyance, transfer or leasing of the premises by the owner or landlord thereof or by foreclosure.
Mass. Gen. Laws ch. 186, § 13