Defects in hydroxymethylbilane synthase (HMBS) can cause acute intermittent porphyria (AIP), an acute neurological disease. Here, HMBS is linked to autoimmune pancreatitis.