A judge has slammed the actions of a Co Tyrone man who sent a “threatening and menacing message” to a Stormont minister.