A former prison officer and inmate have both been jailed for having a sexual relationship and smuggling offences.