AIP patients with defective CYP2D6 alleles may be less susceptible to porphyrogenic xenobiotic intermediate metabolites. Here, CYP2D6 is linked to autoimmune pancreatitis.