The erection and maintenance of watermills and dams to raise water for working them upon or across streams not navigable as provided in Title 38, chapter 5, shall not be deemed a nuisance, unless they become offensive to the neighborhood, or injurious to the public health, or unless they occasion injuries or annoyances of a kind not authorized by said chapter. Fences and buildings fronting on public ways, commons or lands appropriated to public use shall not be deemed nuisances when erected for the times and in the manner provided in Title 23, section 2952, unless the owner of the same shall be estopped as therein provided from justifying his occupation within the limits of said way.
17 M.R.S. § 2797