Boil tomatoes in water for few minutes. Remove from fire and keep closed for another few minutes. Strain and peel off the outer skin from tomatoes. Grind it into a smooth paste. Strain through a strainer to remove the seeds.
Grind all the spice bag ingredients coarsely. Tie them in a thin muslin cloth and put the muslin bag into the tomato pulp. Boil this in medium flame by stirring occasionally, until it reduces to 1/3 of its original volume. Add sugar & salt and mix well. Remove from fire. Then add vinegar. Squeeze out the spice bag using a tong (Do not use hands). Pour it in a clean bottle and store.