Heat the oil in a large pan and add the onion. Cook over a low heat until the onion is translucent.
Add the mushrooms and garlic and continue to cook, stirring regularly, until the mushrooms have softened and all of the excess water has evaporated.
Add all of the rest of the ingredients and bring up to a simmer. Press down the spaghetti so that is is covered by the sauce, give it a good stir, and allow to simmer for about 10-15 minutes, stirring often, until the spaghetti is al dente and the sauce has reduced down and thickened.
Check the seasoning and add more salt/pepper etc as needed. Serve straight away.