Scanning the narrative of "Istitaru'l-Imam" by Ahmad bin Ibrahim an-Naysaburi, who lived under Imam al-Aziz (d. 386/996), it appears that a certain dai Abu Muhammad died at Kufa in 285/898, had left three sons, viz. Abul Kassim, Abu Mahzul and Abul Abbas. Abul Kassim himself took over the charge of the mission in Kufa, but Abul Hussain bin al-Aswad, the chief dai had dismissed Abul Kassim from the post and the latter, together with his two brothers, was furious. They wrote to al-Mahdi, complaining that Abul Hussain deprived them without any serious reason, but al-Mahdi sent no reply to them. The three brothers then conspired, making a sworn pact between themselves, to make a sudden attack on Salamia, and to kill Ibn Basri, who empowered Abul Hussain to commit such an offence on them. They also wanted, if possible, to kill Abul Hussain; if impossible, they intended to report to the government of Syria. News about this transpired to the dai Hamid bin Abbas and Ibn Abd residing at Baghdad. Some Hashimites also wrote to al-Mahdi, informing him that the sons of Abu Muhammad had conspired to kill him with his family. "If you are sitting" as they wrote, "then get up. The three brothers have already started, intending to kill you. If they do not succeed, they will expose you to Ahmad bin Tulun. They say that you are the enemy of the religion, and they want to expose your affairs. Do everything to save yourself without wasting a moment."
Apprehending lest the sons of dai Abu Muhammad and the Qarmatians would resort to the violent and stormy operations, al-Mahdi gave orders to prepare for a journey. He took with him only his son Abul Kassim, Jafar bin Ali, the Chamberian, Ibn Barka and Tayyib, the tutor of Abul Kassim. He abandoned his residence with all that it contained: precious carpets, clothing, property, servants and also the family of his uncle and brother, male and female. He entrusted all his wealth, with his house, wares and granaries, to
Hence, al-Mahdi quited Salamia in a thick of insecure milieu in 286/899. He relinquished his house at the time of the evening prayer, unnoticed by any one and travelled the whole night escorted by an Arab and thirty other horsemen. He arrived at Hims in the morning. Sending back the Arab escort from Hims, al-Mahdi's caravan first left for Damascus when Haroon bin Khamruya bin Ahmad bin Tulun (283- 292/896-904) was the then governor of Syria. They continued to travel whole of that day and the next and arrived in Tiberias on the third. The long journey from Syria was beset with great perils, therefore he continued without a halt in Tiberias and went to Palestine and alighted in Ramla, and putting up with the governor, who was his devout follower.
Ramla was a town, 25 miles from Jerusalem and on the road between Syria and Egypt, covering an area of a square mile. Its chief gates were Darb Bir al-Askar, Darb Masjid Annaba, Darb Bait al-Makdis, Darb Bila, Darb Ludd, Darb Yafa, Darb Misr and Darb Ajun. Ramla was rich in fruits, especially figs and palms. It was famous for comfortable baths, commodious dwellings and broad streets.
In Ramla, al-Mahdi received the news that the three sons of Abu Muhammad had reached Salamia and were vainly searching for him. The three brothers continued searching for al-Mahdi for a whole year. In the interim, one of the brothers, Abul Abbas had returned to Iraq but Abul Kassim and Abu Mahzul remained in Salamia. They often visited Hammah steathily, trying to find out from dai Abul Hussain the informations about al-Mahdi and returning again to Salamia. When they realized that it was futile to find out anything from Abul Hussain, and that they could not trace al-Mahdi, who was lost for them, Abul Kassim, a real cheat, left, while Abu Mahzul continued to stay in Salamia.
Abul Kassim went to the tribe of Qasiyyun, giving them preference over other tribes. He brought them to his favour, such as Banu Malik, Banu Murid, Banu Hujayna, Banu Balwa, Banu Fakhdash, Banu Hudhayl and Banu Ziyad. These tribes swore allegiance to Abul Kassim and rose in rebellion. They marched against Tughuch bin Juff (283-293/896-906), the new governor of Syria, whom they defeated near the village, called Mazzatul Abai. The insurgents inflicted heavy loss on his force and besieged Damascus.
In the meantime, Abu Mahzul quitted Salamia and betook himself to Ramla, while his brother Abul Kassim remained before Damascus, repelling the attacks every day. In Ramla, he incidentlly met Jafar bin Ali in the market, while he was purchasing provisions. A man accompanied Abu Mahzul identified Jafar bin Ali. He followed Jafar and entered the house with him, and sat in the entrance porch, biding Jafar to convey his greetings to the Imam and to tell him that he must have an interview with him. If not, he would at once cry out and reveal the identity of the Imam to the public. So Jafar entered before al-Mahdi and told him what had happened. To this al-Mahdi replied, "Now that he has seen you and discovered us, better bring him in, as otherwise he may expose us." Abu Mahzul was brought before al-Mahdi. He bowed before the Imam and the latter received him kindly. Then Abu Mahzul said, "O my Lord, verily we left our houses, searching after you. Now praise be to God Who helped us to find you. My brother came with a force which besieges Damascus. I left him when he was on the point of taking it. Come back, because your position is so strong now. All purpose of our campaign was to satisfy you and to appease your anger, which was provoked by the machinations of Abul Hussain, who stirred up us against each other. And if you do not wish to come personally, write a letter to my brother, to appease him, as he is angery with me."
Imam al-Mahdi wrote a letter to his brother, asking him to forgive Abu Mahzul, and not to punish him in any way. In short, the sons of Abu Muhammad were impostors and had assumed the girdle of the Ismailism, and there came soon their end. About all these events, al-Mahdi who was staying in Ramla, was well informed. Tayyib, the tutor, was travelling between Salamia and Ramla, carrying the news. So al-Mahdi could see from Ramla what was going on with Abu Mahzul, and what he did after his retreat from Damascus to Salamia.
Jafar narrates in "Sirat-i Jafar" that, "I was waiting on al-Mahdi, together with Tayyib and Abu Yaqub at the table, at which al-Mahdi, the governor, al-Qaim, and Firuz were taking their food, when there entered a messenger, the same who had been sent to Damascus, carrying orders from Baghdad about our arrest, accompanied by the name and description of the appearance of al-Mahdi. The governor read the orders, and handed the paper to him. When the Imam read it also, the governor knelt before him, crying and kissing his feet, and al- Mahdi said to him: `Keep quiet, do not cry. He, in whose hands my life is, will never permit them to catch us.'" So the governor of Ramla wrote to the governor of Damascus in reply to his above letter that no man answering the description had been seen, and it was not known whether he had already passed the town. In case he had not yet passed, a watch would be kept for him on all roads.
Al-Mahdi had to prolong his stay in Ramla for about 2 years on account of the intensive searching of the Abbasids. Ibn Hammad (d. 628/1230) writes in his "Akhbar al-Muluk Bani Ubayd wa Siyaratihim" (Paris, 1927, p. 12) that, "The Abbasids were looking for al-Mahdi, sending letters to all the provincial capitals with his name and description, ordering that he be arrested as soon as he was discovered."
During one night in Ramla, according to "Sirat-i Jafar," there was a shower of shooting stars, so al-Mahdi and his son, the governor and many other people ascended the roof of the house to look at the phenomenon. The town was filled with the shouts of the people. Al-Mahdi pressed with his hand the hand of the governor, and said that the phenomenon was a testimony of his high mission, and one of the signs of his success.
Al-Mahdi resumed his journey and effected his junction in Egypt, where he met dai Abu Ali al-Hussain bin Ahmad bin Daud bin Muhammad (d. 321/932), who had been made the chief of the treasury (sahib bayt al-mal) after the foundation of the Fatimid Caliphate in Maghrib. Imam told him not to accommodate him in his own house, or in the house of any one who was known as being connected with the Ismaili mission, but to arrange for him a place with a trusted outsider. Abu Ali al-Hasan therefore, caused the Imam to lodge with a certain Ibn Ayyas. The governor, Abu Musa Isa bin Muhammad Nushari had received a letter from the Abbasids for the arrest of al-Mahdi. He therefore, summoned Ibn Ayyas, and inquired about the strange person living with him. Ibn Ayyas, according to "Sirat-i Jafar" (p. 113) replied that the person staying with him, by God, was not suspicious in any way. He was a nobleman, a Hashimite, an important merchant, known by his learning, piety and wealth. And with regard to the man who was sought for, news had come that he had left for Yamen long before the arrival of Abbasid letter. The governor trusted what Ibn Ayyas said about his guest.