Mailam is located fifteen kilometres from Tindivanam and thirty from Pondicherry. The temple, situated on a small hill , is connected with a village on the Coromandel coast, Bomayapalaiyam, very near Pondicherry, where a Vera Saiva mutt is found. According to the name, bomma or bomme, derived from brāhmana. This was a village donated to Brahmans, as is confirmed by the sthala purāna.in which Bomayapalaiyam is also named Brahmapuram
The legend of this kshetra begins with the end of Surapadma’s atrocious rule and his tearful appeal to Lord to accept him as his mount. According to sthalapurana, Surapadma, though fought against Muruga with all his might combining the tactile of asuramayopaya, was routed in the end. When he was about be slain, he appealed to the Lord to accept him as his vechicle, and he would serve him with fidelity.
Moved by the tearful appeals, the Lord ordered him to do meditation with great steadfastness taking the shape of peacock on the bank of Varaha near Mailamalai. Nodding, he continued his appeal to the Lord to dwell for ever on the same hill. It was granted. Thus came into existence this Mailamalai and the place called Mailam, for short. The temple atop the hill was built by Pommayapuram, Mathadhipathi on a scale grand and maintenance commendable. The Mutt established at the foot of the hill is attending to the temple administration in an exemplary manner providing conveniences to the visiting public.
There is another long legend associated with the life Sankhakannar, one of the Sivaganas of Kailas. Due to incurring displeasure to Lord Siva, he was cursed to be born as man in Bhuloka and get emancipation after due penance.