Well, Robert Ferrigno has my back covered:
Our present predicament with Iran revolves around the Twelfth Imam, or Hidden Imam, believed by Shiite Muslims to be the last in the line of spiritual/political rulers. The Twelfth Imam, Muhammad al-Mahdi, ascended to his position upon the death of his father, the Eleventh Imam, in 874 AD. Al-Madha at that time was five years old. Shortly after the funeral of his father, al-Mahdi disappeared, believed by Shiites to have been hidden by Allah until his return at some future point. The easiest way for westerners to think of the Hidden Imam is as the Islamic Messiah, Except the Islamic Messiah is to come at the hour of greatest peril for Muslims, come to battle the forces of evil and unite the entire world in an Islamic Caliphate.
Okay, let’s call it a difference of opinion. Armageddon under any other name… However, Ahmadinejad belongs to a small sect of Shiites, called Hojjatieh, who believe that they can hasten the arrival of the Hidden Imam.. Even more threatening for the west, the Hojjatieh believe that it is chaos that will induce the Hidden Imam to reveal himself. They have a spiritual investment in destruction. The worse things get — the worse believers can make things get — the more likely it is for the Hidden Imam to return. None of which would matter much except that Ahmadinejad is adamant about the right of Iran to develop its own nuclear program.
When Khomeini took power after the revolution in 1979, he banned the group, since they opposed the creation of an Islamic state, believing that the peace and tranquility of the new Iran would delay the reappearance of the Twelfth Imam. Hardliners among the Hojjatieh actually consider that Khomeini and the mullahs hijacked the Islamic revolution by limiting it to Iran. The emergence of Ahmadinejad to a position of power under the auspices of these very mullahs suggests to me that they think they can control him, use him as a figurehead to maintain the support of the people. The mullahs too may have underestimated Ahmadinejad.
We have to ask ourselves, how does Ahmadinejad see himself? Shiites believe that there will be no doubt as to the identity of the hidden imam when he returns. it will clearly be him. Some Shiites believe that the Twelfth Imam will rule through a deputy. Or that this deputy will precede his reappearance and actually hasten the arrival. Get the picture?
As to the letter, I think we have to consider it having several functions. Yes, it’s addressed to Bush and was supposed to be “private”, but it was clearly meant for a large audience. The thrust of it is ostensibly a call to Islam and a recitation of the hypocrisies and wounds the west has inflicted on the world. Some have noted that this is in the tradition of Khomeini and bin Laden in following the Koranic teaching of offering ones enemy a final chance to convert before waging war. This may be one of its functions, but I think the main function is to present Ahmadinejad as the deputy of the Hidden Imam.