Section 171. Whoever wilfully deposits excrement or foul or decaying matter in water used for domestic water supply, or upon the shore thereof within five rods of the water, or whoever bathes in such water shall be punished by a fine of not more than fifty dollars or by imprisonment for not more than one month. A police officer or constable of a town where such water is wholly or partially situated, acting within the limits of such town, and any executive officer or agent of a water board, board of water commissioners, public institution or water company furnishing water or ice for domestic purposes, acting upon the premises of such board, institution or company and not more than five rods from the water, may without a warrant arrest any person found in the act of violating this section and detain him in some convenient place until a complaint can be made against him therefor. The provisions of this section shall not interfere with the sewage of a town or public institution, or prevent the enrichment of land for agricultural purposes by the owner or occupant thereof.