Section 1307 - Duty to maintain foreclosed property1. A plaintiff who commences a mortgage foreclosure action , including a lender, an assignee or a mortgage loan servicer, seeking a judgment of foreclosure and sale pursuant to section thirteen hundred fifty-one of this article, involving residential real property, as defined in section thirteen hundred five of this article, that is vacant, or becomes vacant after commencement of the action or the issuance of such judgment, or is abandoned by the mortgagor but occupied by a tenant, as defined under section thirteen hundred five of this article, shall maintain such property until such time as ownership has been transferred through the closing of title in foreclosure, or other disposition, and the deed for such property has been duly recorded; provided, however, that if a municipality or governmental entity holds a mortgage subordinate to one or more mortgages on the residential real property, the municipality or governmental entity shall not be subject to the requirements of this section.2. Such plaintiff shall have the right to peaceably enter upon such property, or to cause others to peaceably enter upon the property for the limited purpose of inspections, repairs and maintenance as required by this section, or as otherwise ordered by court; provided, however, that if the property is occupied by a tenant, at least seven days notice must be given to such tenant, unless emergency repairs are required in which case reasonable notice shall be provided to the tenant.(a) A residential property is deemed vacant for the purposes of this section if the residential property meets the definition of a vacant and abandoned residential property under section thirteen hundred nine of this article or there is an order or finding by a court of competent jurisdiction or by the municipality in which the residential property is located that the property is vacant;(b) A residential property is deemed abandoned by the mortgagor if:(i) All owners of the residential property have indicated in writing that they have abandoned all rights of possession to the residential property;(ii) There is an order or finding by a court of competent jurisdiction or by the municipality in which the residential property is located, either on the initiative of the court or municipality or in response to a complaint filed with the court or municipality by a tenant in lawful occupancy, that the property was abandoned by the mortgagor; or(iii) The plaintiff receives a complaint from a tenant in lawful occupancy of the residential property indicating that the owner of the residential property has ceased maintaining the property and: (1) The plaintiff posts a notice on the residential property that would be reasonably visible to the owner of the property indicating that the property is deemed abandoned and the owner must contact the plaintiff at a number listed on the notice if the owner still occupies or claims the right to occupy the property; and(2) The plaintiff has received no communication within one week of posting the notice of the owner's intention to occupy the property.(c) Such plaintiff shall have the right to peaceably enter upon such property, or to cause others to peaceably enter upon the property for the limited purpose of inspections, repairs and maintenance as required by this section, or as otherwise ordered by court; provided, however, that if the property is occupied by a tenant, at least seven days notice must be given to such tenant, unless emergency repairs are required in which case reasonable notice shall be provided to the tenant.(d) Any plaintiff that enters a residential property without a good faith basis for believing that the property is vacant or abandoned and who does not comply with the requirements of paragraph (b) of this subdivision shall be subject to a penalty of five hundred dollars that may be sought by the owner of the residential property or any tenant in lawful possession of such property. This penalty may be recovered by a property owner or tenant in lawful occupancy of such property either within the foreclosure action pending against the subject residential real property or in a separate action commenced to collect the penalty.3. The municipality in which such residential real property is located, any tenant lawfully in possession, and a board of managers of a condominium in which the premises are located or a homeowners association if said premises are subject to the rules and regulations of such an association, shall have the right to enforce the obligations described in this section in any court of competent jurisdiction after at least seven days notice to the plaintiff in the foreclosure action unless emergency repairs are required. Any entity acting pursuant to this subdivision shall have a cause of action in any court of competent jurisdiction against the plaintiff in the foreclosure action to recover costs incurred as a result of maintaining the property. The authority provided by this subdivision shall be in addition to, and shall not be deemed to diminish or reduce, any rights of the parties described in this section under existing law against the mortgagor of such property for failure to maintain such property.4. In the event the mortgagor of the property commences a proceeding in bankruptcy court prior to the completion of the public auction ordered in the judgment of sale, the duties created by this section shall be suspended during the pendency of the bankruptcy proceeding or until such time as an order has been entered in that proceeding lifting or removing the automatic stay of the foreclosure sale.5. For the purposes of this section maintain shall mean keeping the subject property in a manner that is consistent with the standards set forth in the New York property maintenance code chapter 3 sections 301, 302 (excluding 302.2, 302.6 and 302.8), 304.1, 304.3, 304.7, 304.10, 304.12, 304.13, 304.15, 304.16, 307.1, and 308.1; provided, however, that if the property is occupied by a tenant, then such property must also be maintained in a safe and habitable condition.6. A plaintiff shall be relieved of its responsibilities to maintain the residential real property that is the subject of a foreclosure action for the period that a receiver of such property is serving.7. Nothing contained in this section shall diminish in any way the obligations pursuant to any state or local law of the mortgagor of the property or a receiver of rents and profits appointed in an action to foreclose a mortgage to maintain the property prior to the closing of title pursuant to a foreclosure sale.8. This section shall not preempt, reduce or limit any rights or obligations imposed by any local laws with respect to property maintenance and the locality's ability to enforce those laws.