Whoever, being an officer, employee, or agent of the United States or any agency thereof, engaged in inspection of vessels, upon any pretense, receives any fee or reward for his services, except what is allowed to him by law, shall be fined under this title or imprisoned not more than six months, or both; and shall forfeit his office.