Mesoporous carbon derived from natural vitamin B12 is applied for the first time in organic synthesis and exhibits exceptionally high dual activity for imine formation via the cross-coupling of alcohols with amines and the self-coupling of primary amines.