The Cameroonian military tribunal announced on Monday that its sentence was based on Abbas's failure to denounce acts of terrorism.
As well as the prison terms, the tribunal imposed a stiff fine worth 85,000 euros.
Amnesty International called the sentence a travesty of justice.
Abba has been punished for simply doing his job, RFI said, adding that the judgement puts into question the right of a reporter to inform those who wish to be informed.
"This is a punishment for the whole press, an attempt to criminalise the profession of journalism in Cameroon," said Cameroonian journalists' union leader Denis Nkwebo.
Tanzanian cartoonist Dr Meddy says #FreeAhmed
Prosecutors said that Abba was collaborating with the Nigerian Islamist armed group Boko Haram and failed to pass on information about planned attacks.
But they failed to produce five witnesses they said would prove his guilt and the report of an expert on cybercrime was rejected by the tribunal.
Prior to being transferred to a jail, Abba said he was tortured for three months by intelligence agents.
No proof was put forward against Abba and he has denied all charges.
At the time of his arrest in July 2015, he had been reporting in the north of the country, an area which is often targeted by Boko Haram.