Nothing contained in this chapter concerning rents and profits, or the estimate and allowance of the value of the buildings and improvements, shall extend to any action between a mortgagor and mortgagee, their heirs and assigns, or to any case where the defendant or the person under whom he claims entered into possession of the premises and occupied under a contract with the owner, which was known to the defendant when he entered.
14 M.R.S. § 6962