One-pot formation of piperidine- and pyrrolidine-substituted pyridinium salts via addition of 5-alkylaminopenta-2,4-dienals to N-acyliminium ions: application to the synthesis of (±)-nicotine and analogs.