Alcoholysis is a nucleophilic acyl substitution reaction in which an alcohol functions as a nucleophile. Acid halides react with alcohol to produce esters. The mechanism proceeds in three steps:
First, the alcohol acts as a nucleophile and attacks the acyl carbon to form a tetrahedral intermediate.
Next, the carbonyl re-forms with the loss of a chloride ion.
Lastly, the positively charged intermediate loses a proton to give an ester as the final product along with H3O+, making HCl an overall byproduct of the reaction.
Pyridine is used as a base to neutralize the acidic reaction mixture.
Alcoholysis of sulfonyl chlorides follows a similar pattern and forms sulfonic acid esters.