A presiding officer at a caucus, primary or state or city election, or at an election in a town or district at which official ballots are used, who, when the right of a person offering to vote is challenged for any legal cause, wilfully or negligently fails to require the name and residence of such person to be written upon the ballot offered by him, and to add thereto the name of the person challenging and the assigned cause, before such ballot is received, shall be punished by a fine of not more than five hundred dollars or by imprisonment for not more than six months.
Mass. Gen. Laws ch. 56, § 13