LABUAPI, Indonesia — The high school bookkeeper, Nuril Maknun, faced constant harassment from her boss, the principal.

At school, he often described his sex life and pressured her to have an affair. After work, he would call her and continue his obscene monologues.

“That kind of conversation happened so often I couldn’t even count,” Ms. Nuril said in a recent interview. “I told him, ‘You need to go to a psychiatrist.’ ”

After months of this, she recorded one of the calls so she would have evidence of his behavior.

The result: She lost her job and went to jail. Meanwhile, his career has flourished.