Intramolecular amine-catalyzed aminolysis of an ester