In a medium heavy-bottomed saucepan, heat oil over medium heat. Add onions and garlic, and cook until translucent, 3 to 4 minutes. Add tomatoes, and bring to a boil.
Add the remaining ingredients, and return to a simmer. Cook, stirring occasionally, until thickened, 30 to 35 minutes. Transfer to a food processor, and puree until smooth. Season with salt and pepper. Return to saucepan, and let stand until room temperature.
Will keep in the refrigerator in an airtight container for up to 1 week.