At the virtual sentencing, Lord Justice Clerk Lady Dorrian explained Murray deliberately risked jigsaw identification and that revealing complainers’ identities was “abhorrent”.
She said it was “particularly so, given the enormous publicity which the case in question attracted and continues to attract”.
Murray’s offending blog posts and tweets were written over a period of a month and remained live, unredacted, despite the blogger being told they could potentially lead to the identification of women who had made complaints about Mr Salmond, who was eventually acquitted of all 13 charges.
His previous lawyer John Scott QC told the judges earlier this year Murray saw the Alex Salmond trial as part of “a bigger picture”.
Lady Dorrian said: “It appears from the posts and articles that he was in fact relishing the task he set himself, which was essentially to allow the identities of complainers to be discerned – which he thought was in the public interest – in a way which did not attract sanction.”
She added: “These actions create a real risk that complainers may be reluctant to come forward in future cases, particularly where the case may be high profile or likely to attract significant publicity.
“The actions strike at the heart of the fair administration of justice.
“Notwithstanding the previous character of the respondent and his health issues, we do not think we can dispose of this case other than by way of a sentence of imprisonment.”
Murray was initially given 48 hours to hand himself in to a police station, but after a challenge by his lawyer Roddy Dunlop QC, this was extended to three weeks so Murray can appeal the sentence, although he has to surrender his passport.
In his previous mitigation submission, Mr Dunlop said Murray was a man of “impeccable character” and previously “untarnished reputation”.
Mr Dunlop said sending Murray to prison would be “harsh to the point of being disproportionate”.
He said: “Allowing that the finding of contempt has been ruled by this court to be justified, the question is whether, given all the circumstances, that justification extends yet further to countenancing imprisonment, to taking a retired diplomat with an exemplary background away from his wife, his 11-year-old son, and his baby.”