Scott Jones, 28, of Albion Street, Brighouse, was originally arrested at his home in connection with a separate offence.
No further action was taken against him for that particular offence but police searched the property and found ketamine with a street value of £300 as well as amounts of cocaine and cannabis.
Inspector Mick Dawes, from British Transport Police, said: “Jones had been selling to his friends and following our discovery at his home address, he pleaded guilty to the supply and possession of drugs.”
Jones was arrested and charged with three counts of being concerned in the supply of Class B drugs and two counts of possession of Class B drugs and one count of Class A.
He appeared before Bradford Crown Court on July 28, where he was sentenced to 10 months imprisonment, suspended for 12 months.
He was also ordered to carry out 100 hours of community service, forfeit £350 and must wear an electronic tag for three months.