Place the onions in a saucepan and add cold water to cover. Bring to a boil over medium-high heat. Immediately drain the onions thoroughly and place them in a glass bowl. Toss with the vinegar, salt, allspice, oregano, bay leaves, peppercorns, and chile, if using. Let macerate in the refrigerator for at least 1 day before serving. They will keep, refrigerated, up to 4 weeks.