Paul Bulman used hidden mobile phones to direct operations in a sophisticated operation to sell 70kgs of pentedrone with a street value of £500,000. The synthetic drug mimics the effects of amphetamines and ecstasy and is popular with clubbers.
The 26-year-old had earlier pleaded guilty at the High Court in Glasgow to coordinating the smuggling of the drug from the Netherlands and the supply's subsequent sale.
His girlfriend Sara Walker, 22, who is due to give birth to the couple's baby, was given a community pay-back order after she pleaded guilty to banking £90,000 to buy the drugs in foreign accounts on his instructions.
Police welcomed yesterday's sentences as the result of a painstaking four month investigation, Operation Eris, which began in September 2012.
Detective Inspector Douglas Norrie of Police Scotland said it showed even offenders operating from prison were not "beyond the reaches of the law" and high-lighted the co-operation of various authorities in bringing him to justice. He added: "Bulman orchestrated his criminal network from within prison and through hard work and dedication from police officers and prison staff alike his enterprise was brought to an end."
The operation was halted by watching detectives after the drug ring was smuggled into Aberdeen. It later emerged Bulman, of Knightswood, Glasgow, was a leading member despite the fact he was serving four-and-a-half years in jail for drugs offences.
Prosecuting, Bill McVicar said: "He was directing others in connection with the movement and payment for drugs using mobile phones from prison."
Telephone records showed he set up drug handovers in Dundee and Forfar that led to two of his gang getting jailed last year.
Defence QC Gordon Jackson, representing Bulman, said: "He did what he did while he was in custody. He simply put his hands up and accepted it."
Lord Turnbull told Bulman: "You have demonstrated that your previous custodial sentence had no effect on you.
"You re-offended and the entire sophisticated operation was conducted from within prison.
"You have caused much anguish in the life of Miss Walker and her family and added to her burden by leaving the sole burden of parenthood to her."
The court heard that Walker, a former accounts department worker, met Bulman when she visited a friend in prison. The pair fell in love and he persuaded her to launder the money for her.
Walker, of Possilpark, banked the money and it was sent to accounts in Portugal and Malta to pay for supplies of pentedrone.
However, the judge told her the blame was with her co-accused.
He added: "You were impressionable and only 20 when you first became involved and you have clearly taken steps to put your life back on an even keel."
She must carry out 100 hours of work in the community and was placed under supervision for two years.
Mr Jackson said Walker had not re-offended since being released from jail in January last year and had passed exams to become a fitness trainer.
Paul Brown, defending Walker, said: "She carried out Mr Bulman's instructions and was wilfully blind to what she was doing. She is described as a low risk of re-offending."