one-pot method for the synthesis of acyclic N-(1-methoxyalkyl)amides starting from carboxylic acid and methyl imidates has been developed and applied to the first total synthesis of (+)-pederine (1), a potent insect poison. Furthermore, the stereocontrolledtotal synthesis of 1 was also achieved by employing acid catalyzed double alkoxy-exchange reaction of N-(1 -methoxylakyl)amide group as key step.