The two have a long history together. According to opposition sources, they first met in 1982, when a young Ahmadinejad was governor of the city of Khoy in West Azerbaijan Province. Around the same time, Mashai was appointed part of the team responsible for the security of the neighboring Kurdistan region by Iran's Intelligence Ministry.
The two became good friends, and when Ahmadinejad was appointed governor in Ardebil Province, he made Mashai a part of his team, along with Sadegh Mahsooli (currently Minister of Welfare and Social Security) and Mojtaba Samare Hashemi (a senior adviser). Today, they are known as members of Ahmadinejad's ‘Ardebil circle.’ Both are also believed to be followers of Ayatollah Mesbah Yazdi and his messianic teachings.
Mashai, whose daughter is married to Ahmadinejad's son, is a controversial figure that last year was rapped by hardliners and Khamenei for saying Iran is a "friend of the Israeli people."
The Islamic republic has repeatedly vowed never to recognize Israel, which was an ally of pro-US shah Mohammad Reza Pahlavi, ousted by the 1979 Islamic revolution.
Esfandiar Rahim-Mashai claimed publicly that he had been told by Mahmoud Ahmadinejad, "You are being attacked because of me. They cannot attack me so they have a go at you."
Ahmadinejad hasn’t openly declared that he wants Mashai to replace him. But there’s plenty of tantalizing circumstantial evidence to suggest he does, something that hasn’t gone unnoticed in Iran.
"According to Islamic Republic News Agency reports, Ahmadinejad has described Mashai as a 'pious man who is a devotee of Imam Mahdi,' a Shiite saint whose return is awaited by believers. Recently Mashai said that he is in contact with Imam Mahdi directly.
The claim that this crisis passed because the "Green" opposition to Ahmadinejad's election has disappeared or been muted always missed the wider point. Even if Government repression could take people off the streets and break up their communications, many within the Iranian establishment were not satisfied that the President had established authority. Indeed, many see him as counter-productive, sapping any strength that the Iranian system can claim.