Peel and finely dice the onion and garlic. Heat the olive oil in a pan, and sauté both. Rinse the tomatoes and blanch for a few seconds in boiling water. Remove from the water and peel. Quarter the tomatoes, then add to the pan with the onions and garlic.
Add the vegetable stock, 2 sprigs of basil, the thyme, and the oregano. Bring to a boil, reduce the heat, and simmer for 10 minutes. Remove the herbs, then pass through a food mill.
Bring to a boil, then add the ketchup. Season to taste with salt and pepper. Remove the leaves from the remaining basil, then add to the sauce. Fill the prepared, sterilized jars to the brim with the sauce. Seal tightly and cool completely.