An Iranian court has sentenced an Iranian-American journalist, accused of spying for the United States, to eight years in jail.