Whoever, at any primary election, being a presiding officer or judge, knowingly and wilfully receives, or advises or consents to the receiving of, the vote of any person not entitled to vote at such primary election; or whoever, at any primary election, being a presiding officer or judge, knowingly and wilfully refuses to receive the vote of any person entitled to vote at such primary election, shall, for every such offense, pay $100 to any person who sues for the same or be fined not less than $100, and, in either case, be imprisoned until the judgments, fines and costs are paid in full or discharged by the court.