Al-Maawardi (rahimahullah) has a strange story regarding sincerity in authoring books. He authored books in the fields of Tafseer (Qur’aan exegesis), Fiqh (Islamic jurisprudence) and other fields. However, not a single book was published during his lifetime. He authored these books and hid them in a place which no one knew about, and at the time of his death he said to a person he trusted:
“The books that are in such and such place were all authored by me, and the reason I did not make them public during my lifetime is because I was not able to make my intention sincere for the sake of Allah.
When you see that I am dying, put your hand in mine; if I squeeze your hand, then know that nothing was accepted from my deeds, so take these books and throw them into the River Tigris. However, if my hand relaxes, then know that I was accepted and got what I was hoping to get.”
That man said:
“When his death approached, I put my hand in his hand and his hand was relaxed and he did not squeeze my hand, so I knew that it was a sign of acceptance and I made his books known publicly.”
[Siyar A’laam An-Nubalaa’ (66/18) and Taareekh Al-Islaam (169/7)]
He (rahimahullah) did not do what many authors do nowadays, which is to go around seeking to get someone famous to introduce their books, say words of praise about them and are very keen on protecting copyrights. Contrary to this, Al-Maawardi (rahimahullah) was keen on monitoring his intention and did not publicize his books because he feared he did not have a sincere intention and thus he refrained from making them known.
[From the book: Sincerity by Sh. Salih al Munajjid, page 47-48]