Peel the onions, then roughly chop along with the carrots, celery and porcini. Place in a large pan over a medium heat with a splash of oil and the herbs. Fry for around 25 minutes, or until turning golden, stirring occasionally.
Add the port and jam and continue to cook for a further 5 minutes, or until sticky and caramelised.
Stir in the flour, then add the Marmite, tomato purée and vinegar. Pour in the stock, then bring to the boil. Reduce to a simmer for around 10 minutes, or until thickened and reduced.
Pass it through a sieve into another large pan, using a spoon to squeeze out all those lovely flavours.