
Soak the porcini mushrooms in 200 ml boiling water for 15 minutes.
Place the red onion, garlic, rosemary, and sun-dried tomatoes in a food processor and pulse until coarsely chopped.
Heat a splash of oil in a heavy-bottomed pan and stir-fry the mixture from the food processor along with the grated carrots for 10 minutes.
Cut the soaked porcini mushrooms into small strips and add them to the pan along with the soaking liquid and tomato paste, stirring well.
Add the peeled tomatoes and crush them with a wooden spoon.
Add the lentils; there is no need to drain them from the pouch first.
Add the celery strips and let the sauce simmer gently on low heat for another 15 minutes.
Meanwhile, prepare the spaghetti according to the package instructions.
Drain and reserve a large cup of the cooking water.
Mix the spaghetti into the sauce, adding some cooking water if the dish is too dry, and serve.
Top with a little Parmesan cheese if desired.