The answer is: if a valid purpose can be identified, then there is nothing wrong with it, because the right of disposal belongs to the buyer; if he relinquishes it, it is his right to do so. Yet the question remains: is there a valid purpose that warrants the buyer’s relinquishing his right of disposal?
There may be such a purpose. For example, I may own a slave and know that a certain person would never buy him directly from me, either out of compassion for me or for some other reason. So I sell him to someone else and say, “On condition that you sell him to that person.” This is a valid purpose, because I would like to do that person a kindness through him, but I know that if the offer comes through me, he will not accept it; whereas if it comes through someone else, he may accept.
Thus, if there is a valid purpose, the sound view is that there is nothing wrong with the seller stipulating that the buyer sell it on. However, the valid purpose here must relate to a specific individual, not to a sale in general. Likewise, if he stipulates that the buyer give it away as a gift, we say that this condition is invalid.
If I were to say, “I sell you this item on condition that you endow it for the fighters in the path of Allah,” then according to the madhhab this is invalid. Yet they have mentioned a report that Uthman, may Allah be pleased with him, bought some land from Suhayb, may Allah be pleased with him, and Suhayb stipulated that he endow it as a charitable trust (1). This indicates that it is permissible to stipulate that the item sold be made an endowment, because this serves an interest—an interest for me and an interest for you. As for me, it falls under cooperating in righteousness and piety; and as for you, the reward will be yours. This may be better for you than the world itself. Therefore, the correct view in this matter is that if he stipulates that it be directed toward something good, there is nothing wrong or objectionable in that.