Darren McCole, 36, was still on licence from a previous prison term when police caught him in possession of heroin twice in six weeks.
He claimed it was for his own use, but a jury at the High Court in Edinburgh convicted him of being concerned in the supplying of heroin. It took little more than ten minutes to return the unanimous verdict.
The judge, Lord Hardie, said McCole, of Dunfermline, had a substantial criminal record, running to more than 30 previous convictions. And as two of those were for class-A trafficking offences - LSD in 1994 and heroin in 2005 - McCole came under legislation that stipulated a minimum seven-year sentence.
"You clearly have not learned any lessons," Lord Hardie told McCole yesterday.
The court heard that McCole was found to have 1,000 of heroin on 19 October last year, and then 800 of the drug on 1 December. The defence counsel, Michael Anderson, said the accused's entire adult life had been blighted by drug addiction.
He added the quantities of heroin were among the lowest in weight and value to feature in a case in the High Court, and he asked the judge to find there were special reasons to spare McCole from jail.