Dublin Circuit Criminal Court heard that real firearms in packages addressed for delivery to Ireland were seized in the United States.
Gardaí decided to perform controlled deliveries of imitation firearms to the addresses.
Caitriona Miller (41) agreed to organise addresses for car parts to be sent on the request of a man who was renting a room in her house at the time.
She later received a call from one of the addresses informing her that the package delivered in fact contained a gun.
Abbie Mangan (29) told gardaí that she had expected to receive a delivery of car parts, but when she opened the package it contained what she believed was a child's toy. It was an imitation firearm.
The court heard that more than €13,000 of cocaine and cannabis was found during a search of Mangan's address.
Miller, of Ballyogan Green, Carrickmines, Dublin, pleaded guilty to possession of an imitation firearm at The Rectory, Enniskerry Road, Stepaside, Dublin on October 12, 2018.
She has one previous conviction for speeding.
Mangan, of Ballyogan Green, Carrickmines, pleaded guilty to knowingly permitting a person to be in possession of cocaine and cannabis at a premises at her address on October 12, 2018. She has no previous convictions.
Sentencing Miller yesterday, Judge Pauline Codd said that the accused "naively" involved herself in this operation, but that she did so for money.
She said she accepted that Miller was under "considerable duress" at the time and had been trying to pay her son's drug debt.
She noted that Miller has been assessed as being at a low risk of reoffending.
Judge Codd sentenced Miller to two-and-a-half years imprisonment, but suspended the sentence in its entirety on strict conditions.
Sentencing Mangan, Judge Codd said this was "a sinister and nasty type of offence" to be involved in and which piles "misery on top of addicts and their families".
The judge said she took into account Mangan's level of co-operation with gardaí and that she was a person with no previous convictions.
She noted Mangan had expressed remorse and described herself as being mentally vulnerable at the time of the offence.
Judge Codd sentenced Mangan to three-and-a-half years imprisonment, but suspended the sentence in its entirety on strict conditions.
Detective Sergeant David Thornley told Karl Finnegan BL, prosecuting, that in October 2018 US Homeland Security investigations in Buffalo, New York, resulted in the interception of two packages containing real firearms which had been destined for addresses in Ireland.
Det-Sgt Thornley said gardaí were informed and they decided to perform controlled deliveries of imitation firearms to the addresses in Stepaside and Carrickmines.
The detective sergeant said that following the controlled delivery being made to the address in Stepaside, gardaí observed Miller enter the address and then leave with the package containing the imitation firearm.
She was arrested and the package was retrieved from her car.
The detective sergeant said that following the controlled delivery being made to Mangan's address in Carrickmines, gardaí searched the premises and found quantities of cocaine and cannabis.
The total value of both drugs was €13,689.