Throughout his 15-month incarceration and three-week espionage trial, Australian filmmaker James Ricketson has lived under appalling conditions, locked up in Cambodia’s notorious Prey Sar prison.

That stay was extended when after a bench of three judges found him guilty of spying for “foreign states” and sentenced him to six years behind bars.

It was the latest saga in an extraordinary era in Cambodian politics that culminated in Hun Sen winning all 125 seats in the National Assembly at July elections, which were bereft of opposition and was widely discredited.

As espionage trials go Ricketson’s case was a scriptwriter’s dream; government intervention of the highest order and he enjoyed popular support at home in Australia with a petition garnering 70,000 signatures demanding his immediate release.

Hollywood arrived with acclaimed director Peter Weir testifying on his behalf, there was even a sex scandal – albeit an erroneous one – with Ricketson, a six-foot three-inch bear of a man, attempting to save impoverished families from life in Phnom Penh’s rubbish dumps.

But the reality was far different. James Ricketson is not James Bond.

What emerged from the Phnom Penh Municipal Court was a portrait of a man who struggled to make ends meet as a filmmaker, failed to distinguish between journalism and political activism, rarely heeded advice and was a hopeless do-gooder who never knew when to quit.

It was more the stuff of a Boy’s Own Adventure but the authorities took a different view and arrested Ricketson a day after he flew and filmed from a drone over an opposition rally, without a permit.

The court heard he had shot secret locations of security deployments and by his own admission had offered the footage to Sam Rainsy, then leader of the now banned Cambodian National Rescue Party (CNRP).

It was bitter pill for a legal team that had built its defence around Ricketson’s credibility as an independent journalist and a caring man who rescued children from scavenging and life on the streets. More was to follow.

He drafted and sent letters to then Australian prime minister Malcolm Turnbull, which went unanswered. Ricketson told the court nine out of 10 letters he writes get no reply.

In one letter; “Cambodian politics for dummies”, he said: “Hun Sen and the CPP have plundered the resources and stolen land from tens of thousands and thrown in prison people who objected.”

He even urged Turnbull not to shake hands with Hun Sen – otherwise he risked having that moment “frozen in eternity”.

“It seems like you defamed the prime minister, it seems like you say something bad about the leader and the CPP and support the CNRP. This is not journalism,” judge Koy Sao said.

Ricketson was defiant.

“This may not be pleasant for the prime minister [Hun Sen] or many Cambodians. I was merely trying to influence the opinion of my prime minister,” Ricketson said. “My opinion at the time was that the CNRP was the better political party.”

Ricketson often squabbled with his lawyers. He sacked one and seemed determined to conduct his own defence, which backfired on day five of his trial when he took the stand and spoke at length about his political leanings, incriminating himself.

The son rises in Cambodia after Hun Sen's rigged election

Another email to his brother said: “It is fascinating to be behind the scenes and to be observing the way Sam Rainsy is plotting to become prime minister.” He added: “As you can imagine, life in Phnom Penh is quite exciting right now.”

But for the prosecution the coup de’grace was an opinion piece titled “Cambodian Spring”. According to his emails, he asked Sam Rainsy’s wife, Tioulong Saumura, to fact-check it and look for anything “misleading in any way”.

This included an advertising campaign focusing on “Change” ahead of the 2013 poll but the Cambodian Spring became much more than that. It was a series of violent post-election demonstrations staged by the CNRP after it failed to win a majority and refused to accept the result.

Sam Rainsy accused Hun Sen and his ruling Cambodian People’s Party (CPP) of widespread electoral fraud and the acrimony turned deadly when six protesters were shot dead in early 2014.

Judge Seng Leang asked Ricketson whether the Cambodian Spring should be seen in the same light as the violence of the Arab Spring. Ricketson preferred the Paris Spring, which he said “was committed to peaceful protest and non-violent change”.

That line did not win over the judges.

Following his arrest, local media reported a love tryst involving an American named James, with a similar sounding last name as Ricketson, and Monovithya Kem, daughter of current CNRP leader Kem Sokha.

It was part of a dirty, grubby campaign to sully the names of senior CNRP figures in a country where sexual impropriety matters among voters. And it was nonsense.

But Hun Sen then claimed Sam Rainsy was fomenting a “colour revolution” with United States support as a year-long investigation into Ricketson’s computer files led to charges he had jeopardised national security and was charged with crimes under Article 446 of the Cambodian penal code dating back to 1995.

Japan plays China's game in Cambodia. Hun Sen wins

Meanwhile, Hun Sen and his CPP were tightening the screws on dissent ahead of another election. The CNRP was dissolved through the courts and its members fled overseas, many were jailed and media outlets closed as Ricketson wallowed in Prey Sar.

He lost weight, contracted scabies, lice and other diseases before he was eventually transferred to a prison infirmary where tuberculosis is rife. But he did get a bed.

Moral support was always on hand.

His son Jesse and partner Alexandra tended all his needs as a Congo line of Khmers testified how Ricketson had paid for their schooling, bought them rice and baguettes, and one wept openly when telling the court how the filmmaker had nursed him when sick.

Peter Weir told the court Ricketson was an innocent abroad who had made a mistake, and had apologised, and many in the court firmly believed there was no case to answer.

Prosecutor Seang Sok did not produce one witness. He did not name one victim, or name one country who Ricketson supposedly spied for, saying only that he collected information damaging to Cambodia on behalf of “foreign states”.

Civil war to UN peacekeepers: can Cambodia's blue helmets find peace - for themselves

He did prove, however, that Ricketson rarely had any money, stayed in five-dollar-a-night hotels, rented a cheap motorbike in Cambodia and supplemented his income driving taxis in Sydney. He was only able to make ends meet and spare something for the poor after his father died and left him a small inheritance.

Hardly the stuff of espionage.

When Ricketson walked into court on Friday he was confident that justice would find him not guilty, telling this journalist the Cambodian judiciary would be embarrassed if he was found guilty and embarrassed if he was not, given they way he has been treated.

“It’s a choice between two evils,” he said from his holding cell.

But he became upset with the verdict and the harsh sentence, pleading to be told who he had worked for. He got louder as he was whisked away behind the bars of prison van as it drove down a busy street and back to Prey Sar.

“Who did I spy for?” he yelled. “Please tell me.”

Ricketson isn’t the only person who’d like an answer to that question.