Sift the flour and baking powder into a bowl, then mix in the sugar, the seeds of the vanilla bean, and the grated zest of half a lemon.
Cut the soft butter into small pieces and add along with the egg, the egg yolk, the rum, and a pinch of salt and mix.
Stir in the milk and move the dough onto a lightly floured surface. Knead it until you get a soft dough, then wrap it in cling film and let it rest for 30 minutes at room temperature.
Divide the dough into six parts and make a thick cord from each piece.
Cut each cord into pieces of about 2 cm, then work them with your hands to form balls.
Heat the oil and fry a few balls at a time, paying close attention to the temperature of the oil. It must be hot but not excessively so, because otherwise the castagnole will burn on the outside and remain raw inside. Drain the castagnole and let them dry on absorbent paper, then roll them in the granulated sugar.