If you are going to preserve jam, prepare jars and lids: place 3 half-pint jars on a rack in a large pot. Add enough water to cover jars, and bring to a boil over high heat. Boil for 10 minutes, then turn off heat and allow jars to rest in hot water. Meanwhile, put bands and lids in a small saucepan and cover with water. Heat over medium heat until water is simmering, then remove pan from heat and allow bands and lids to rest in hot water until ready to use.
Combine tomatoes, sugar, lemon juice, ginger, red pepper flakes, salt, cinnamon, and cumin in a large, heavy-bottomed pot and bring to a boil over medium-high heat, stirring frequently. Reduce heat and simmer until mixture reaches a thick, jam-like consistency, about 2 ½ hours. Stir in pectin (if using) and simmer for 1 minute more.
Ladle hot jam into hot sterilized jars, leaving ¼-inch headspace. Wipe rims of jars, cover with lids, and screw bands on until just barely tight. Place jars on rack in pot and cover completely with water. Cover pot and bring to a boil over high heat. Boil for 15 minutes. Turn off heat, uncover pot, and allow jars to rest in water for 5 minutes. Remove jars from pot and allow them to rest undisturbed on countertop for 6 hours or overnight.
