An Italian court on Wednesday sentenced a man to 12 years in jail for shooting and wounding six African migrants in a racially motivated attack in the central city of Macerata.