A detectives has told how a "fine-toothed electronic comb" was used to track down the teenager behind a series of threatening letters to public figures.
DI Alastair Blair: "Deliberate, cruel and calculated act"
The High Court in Edinburgh heard that Paul Smith had been "groomed" over the internet by the head of an anti-English Scottish terrorist organisation.
The 17-year-old, from Dumbarton, sent a letter claiming to contain the poison ricin to Prince William at St Andrews University in Fife and posted a bottle of aromatherapy oil laced with caustic soda to prime minister's wife Cherie Blair.
Pain-staking investigative work by Fife Constabulary's computer crime section played a major role in catching the school pupil.
Smith was sentenced to three years detention at the High Court in Edinburgh for sending more than 40 letters and packages between August 2001 and February last year.
Detective Constable Alistair Blair said officers had worked backwards from the computer footprint created by the e-mails at the heart of the investigation.
He believes that the force was the first to achieve such a feat.
"It is now an established routing which can be followed in pursuit of others who might ever choose to abuse the system in a similarly evil way," he said.
"We had to analyse with a fine-toothed electronic comb all the e-mails, eventually tracking them back to him after hours and hours or trawling through internet accounts and other sources of possible information.
"When we had enough to search Smith's home we found everything still on his computer, from original scripts to details about the content of the powders to be used and, perhaps even more crucially, the people who were to be on the receiving end of his poisoned plans."
Smith is led away from the High Court in Edinburgh
DI Blair said that those on the receiving end of the letters would have experienced "considerable fear and trepidation".
"If I personally had opened one myself I would have been absolutely terrorised," he said.
"In my opinion this was a deliberate, cruel and calculated act by Smith, the impact of which cannot be underestimated.
"This was the work of a bad, evil even, young man whose mind-set I found very difficult to break into as the investigation continued to unroll.
"But perhaps what struck me most throughout was the fact that all this disruption, chaos and upset had been caused by someone who was only 16."
He said it would have been a "truly horrific experience" for those affected.
"We can only imagine the effect of being told they were about to die, of being placed into quarantine by people in chemical suits and of being robbed of their dignity at a time when the whole world was living in fear of similarly horrendous acts of terrorism," added DI Blair.