In an e-mail MacGregor described himself as a "proud racist"
A Derbyshire man who threatened to blow up Glasgow Central Mosque has been sentenced to three years' probation.
Neil MacGregor, 36, had also said he would execute a Muslim a day unless all of Scotland's Mosques were closed.
He made the threats after watching an internet video of a British hostage being beheaded in Iraq.
Sheriff Andrew Mackie said he did not believe custody would help to address the root cause of MacGregor's problem which was his mental health.
At an earlier hearing, MacGregor, from Melbourne, Derbyshire, admitted a racial breach of the peace.
He telephoned and e-mailed Strathclyde Police to make the threats from a flat in Glasgow, between 30 January and 15 February 2007.
The court heard that the e-mail read: "I'm a proud racist and National Front member.
"We as an organisation have decided to deal with the current threat from Muslims in our own British way, like our proud ancestors.
"Our demands are very small. Close all mosques in Scotland.
"If our demands aren't met by next Friday, we'll kidnap one Muslim and execute him or her on the internet, just like they did to our Ken Bigley."
MacGregor then followed up the e-mail with a call threatening to blow up Central Mosque.
Sheriff Andrew Mackie said a custodial sentence had been uppermost in his mind given the nature of the offences.
But he added: "The psychiatrist considers that your condition at present, following the treatment you have received, does not require your immediate admission to hospital but does consider that you would benefit from ongoing treatment.
"The most up-to-date social enquiry report recommends that you be made the subject of a probation order with a condition that you attend for psychiatric treatment as directed by your supervising officer.
"I am prepared to make such an order to minimise the risk of you becoming involved in such behaviour again."
Muslim leaders criticised the way MacGregor's case was dealt with by the police and courts.
Osama Saeed, of the Scottish-Islamic Foundation, said he believed that if a young Muslim had similarly threatened violence after viewing videos from Iraq, he would have been dealt with completely differently by the police.
MacGregor's defence lawyer Craig Dewar told the court that MacGregor had been in contact with figures from the mosque to personally offer his apologies.