Put the tomatoes, apples, onions, garlic and vinegar in a preserving pan or large, heavy-based, stainless steel saucepan. Slowly bring to the boil, then reduce the heat and simmer for 30 minutes, or until tender, stirring the mixture occasionally.
Add all the remaining ingredients, including the pickling spices, if using, and heat gently, stirring frequently until the sugar has dissolved. Bring back to the boil, then simmer uncovered for 2 hours, stirring often towards the end of the cooking time, to prevent sticking. By this time the chutney should be well-reduced and very thick – if necessary, cook for a few more minutes.
Spoon the chutney into warm, sterilised jars. Cover the chutney with discs of baking paper to cover the surface completely. Cover the jars with cellophane or plastic screw-topped lids (not metal lids, as they will corrode). Tighten the lids when the chutney is completely cold and label.
Store in a cool dark place and leave to mature for at least 1 month, before eating. Use within 1 year of making. Once opened, store in the fridge and use within 1 month.