Prepare the leeks by cutting off the roots, the coarse green leaves and the damaged outer layer. Run under the tap to get rid of the dirt and grit. Slice them into a colander and rinse again. Cook them gently in the butter till soft.
Line a shallow pie dish with a layer of pastry, and turn the leeks and the ham (chopped small) on to it.
Mix cream and eggs well together. Season with salt and plenty of pepper and strain into pie dish. Cover with a pasrty lid, and brush with milk.
Bake for about 30 minutes in a 350F oven.
This pie tastes better warm than hot. If you prefer a flan, just cook without the pastry lid.