John Meechan 35, of New Cordale Road was selling the pills from June 2014.

The complainer, who had problems sleeping, went on internet store Ebay to purchase anti-anxiety medication and saw an advert for ‘insomnia relief pills’.

There was no name for the seller, but had an address in West Dunbartonshire and a paypal account with a woman’s name.

The witness bought 100 tablets for £48.99 which arrived a week later. Upon opening the box he noticed it was labelled ‘Diazepam 500mg’ on the side of the packet, but took the pills anyway to help him sleep.

After a few days the witness felt very unwell, and phoned the police.

After discussions with the witness and Ebay’s security team, police arrested Meechan on the morning of July 8, 2014.

During a search of his flat police found boxes of Diazepam – 1,105 tablets in total – empty shipping boxes, envelopes, post office receipts, and computer equipment.

Meechan admitted the Diazepam was his, and he had been using his mother’s paypal and email account to supply the drugs without her knowledge to supply the Class C drug.

Meechan said he sold the pills on nine occasions from April 27 to July 28 2014, all posted using Royal Mail.

The most pills sent in one go was 150, and the fewest was 30.

Meechan had been purchasing the pills elsewhere and selling them on.

Sheriff Gallacher told Meechan he was facing a custodial sentence: “This is a very serious event, you were deliberately obtaining money by supplying drugs. With hesitation I will allow bail to continue, do not prepare to walk out the door again when you walk in.” Bail was continued until July 7 for a social work report.