Preheat the oven to Gas Mark 6, 200°C, (400°F).
Heat a large pan over a medium heat, add in the butter then gently sauté the leeks, onions and mushrooms until soft. Add in the flour and cook for a minute, then gradually stir in the milk. Continue to cook, stirring all the time until mixture thickens and begins to boil. Then add in the ham, mustard, tarragon and black pepper, then check for seasoning.
Pour into a pie dish. Cover with a sheet of puff pastry, brush with the beaten egg, make a slit in the top of the pie and bake for 30 minutes until the pastry is golden. Serve with salad.