In a medium pot, heat the oil over medium heat. Saute the onion until translucent. Add the garlic and season with salt and pepper. Add the vinegar, sugar, ketchup and mango. Simmer over medium heat for 10 minutes, or until the mango is soft.
Let the mixture cool slightly then blend until smooth. Adjust the seasoning and add chile powder or red pepper flakes, if desired.