On a night in June 2011, a man named Brian Stacy sent emails to a federal judge that a defense lawyer would later describe as “vile, crude, bigoted, racist, homophobic and offensive in many ways.”

The notes were laced with misspelled words, grammatical mistakes and exclamation marks. They featured numerous racial epithets. And one of the emails, prosecutors said, explicitly threatened to kill the judge.