Section 162. Upon petition to the department by the mayor of a city or the selectmen of a town, the managing board or officer of any public institution, or by a board of water commissioners, or the president of a water or ice company, stating that manure, excrement, garbage, sewage or any other matter pollutes or tends to pollute the waters of any stream, pond, spring, underground waters, or watercourse used by such city, town, institution or company as a source of water supply, the department shall appoint a time and place within the county where the nuisance or pollution is alleged to exist for a hearing, and after notice thereof to parties interested and a hearing, if in its judgment the public health so requires, shall, by an order served upon the party causing or permitting such pollution, prohibit the deposit, keeping or discharge of any such cause of pollution, and shall order him to desist therefrom and to remove any such cause of pollution; but the department shall not prohibit the cultivation and use of the soil in the ordinary methods of agriculture if no human excrement is used thereon. The department shall not prohibit the use of any structure in existence on June eleventh, eighteen hundred and ninety-seven, upon a complaint made by the board of water commissioners of any town or by any water or ice company unless such board of water commissioners or company files with the department a vote of its city council, selectmen or company that such town or company will at its own expense make such changes in said structure or its location as said department shall deem expedient. Such vote shall be binding on such town or company. All damages caused by such changes shall be paid by such town or company; and if the parties cannot agree thereon, the damages may be recovered under chapter seventy-nine. Whoever violates such an order, (a) shall be punished by a fine of not more than twenty-five thousand dollars, to the use of the commonwealth, for each day that such violation occurs or continues, or by imprisonment for not more than one year, or both such fine and imprisonment; or (b), shall be subject to a civil penalty not to exceed twenty-five thousand dollars per day for each day that such violation occurs or continues.