Wash the tomatoes and cut them into larger pieces. Peel and core the apples and cut them into cubes. Peel and coarsely chop the onions.
Prepare a large pot with a lid. Put the chopped ingredients in it, add salt, sugar, vinegar, and other spices (bay leaves, allspice, pepper, sweet paprika).
Cover the pot with a lid and bring the mixture to a boil. Reduce the heat and simmer at a low temperature for 30 minutes under the lid. Then remove the cover and simmer on low heat for another 3 hours without stirring.
Strain the cooked mixture through a sieve, about two ladles at a time. The strainer will retain the skins and seeds of the tomatoes and the remaining spices. Always dispose of the leftovers in the waste bucket before pouring the new mixture from the pot into the strainer.
Return strained ketchup to the pot and cook over medium heat until thickened. The cooking time depends on the liquid content of the tomatoes. This takes anywhere from a half-hour to two hours. I cooked my tomato mixture for another 1.5 hours.
In the meantime, clean the jars with screw top lids. I washed them in a dishwasher; they were still hot when I used them.
Carefully pour the thickened ketchup into the prepared jars and seal them with a screw lid tightly. Turn the jars upside down and let them cool completely.