Esfandiari Rahim Mashaei, a vice president, chief of staff, and senior aide under former Iranian President Mahmud Ahmadinejad, has been sentenced to 6 1/2 years in prison after being convicted on charges including threatening national security, Iranian media report.