§ 265. Tax a lien; exceptions. The tax in this article imposed shall be deemed and is hereby declared to be a lien upon the mortgage upon which such tax is imposed and upon the debt or obligation secured thereby, except that upon mortgages recorded prior to July first, nineteen hundred six, such lien shall extend only to that portion thereof represented by the amount advanced subsequently to such date and to the debt or obligation secured by such advancement, and for the purpose of enforcing the payment of the tax in this article imposed, such mortgage and the debt thereby secured shall be deemed to be property within this state notwithstanding that such mortgage may be owned by or be in the possession of a person or corporation outside the state and a copy thereof duly certified by the recording officer of any county in which such mortgage is recorded shall, for the purpose of enforcing the payment of such tax, be deemed to be, and shall have the same force and effect as the original mortgage and may be sold to satisfy such tax and upon a sale of the whole or any part thereof, shall carry with it and transfer to the purchaser all the rights, interests and obligations of the mortgagee therein named or his assignee or successor in interest in and to such mortgage and the debt secured thereby, or the part thereof to which such lien attaches, together with interest and costs. The lien of the tax resulting from a deed of trust or a deed absolute on its face which is security for a debt or obligation shall cease ten years after the recording thereof, provided such a mortgage is in the hands of a bona fide purchaser for value.