Timothy Rustige, 65, was found guilty of causing Dame Elish Angiolini fear and alarm by subjecting her to a campaign of harassment.
Dame Elish QC feared for her family's safety after the conspiracy theorist targeted her between February 27 and March 22, 2012.
The former Lord Advocate said she had been subjected to threatening emails and blog posts saying she was responsible for the "cover-up" of an alleged paedophile ring in Aberdeen.
Yesterday at Aberdeen Sheriff Court, Rustige was sentenced to nine months in prison for the harassment.
Sheriff Principal Derek Pyle called it a "very serious offence" against one of the highest offices in the land.
He said: "What you have done is attack - not physically - somebody who has just been Lord Advocate ... one of the great offices of the state of Scotland.
"I'm entirely satisfied that only a period of imprisonment is appropriate."
Rustige, who denied the charges, was found guilty last month. Sentencing had been deferred for reports.
The court previously heard how defamatory emails had been sent to Aberdeen, Strathclyde and Oxford universities claiming Dame Elish was a "satanic woman".
The emails, which were read out in court, claimed various figures, described as the "great and good" of the area, had been sexually abusing a young girl.
They claimed Dame Elish had been aware of this in her duty as Lord Advocate and had covered it up.
Rustige was also given a five-year non-harassment order and barred from having more than one email address.