In preparation, wash and thinly slice the leeks, thinly slice the mushrooms, peel and crush (mince) the garlic and roughly shred the ham.
Heat the oil in a large saucepan, stir in the sliced leeks along with 2 tablespoons of water, a pinch of salt and a couple of twists of freshly ground black pepper. Cover the pan and cook for 5-6 minutes over a medium heat until the leeks have softened. Add the crushed garlic and sliced mushrooms, then cook for a further 3-4 minutes.
Meanwhile, cook the spaghetti according to the instructions on the pack (usually about 5-7 minutes in boiling, salted water), then drain, reserving a little of the cooking liquid. Stir the soft cheese into the leek and mushroom mixture in the pan and add a little of the reserved pasta liquid to create a sauce-like consistency. Stir in the ham, the Parmesan cheese and the basil leaves, then toss in the spaghetti and mix well. Serve hot with a glass of dry, white wine.