Put the red onions, shallots, chilli and garlic into a food processor and blitz to a smooth paste.
Heat the olive oil in a frying pan and fry the onion paste together with the sundried tomato paste for 5 minutes.
Now add the chopped tomatoes, sugar and lemon juice. Stir and bring to the boil, then simmer for 15 minutes.
Season with salt and pepper and take off the heat.
For a smoother sauce, blitz the ingredients with a hand blender.