Wipe mushrooms clean with a damp cloth, or brush them clean. Avoid washing them if possible; if it is necessary, swish them rapidly through a bowl of water and lift and drain them promptly. Trim off any discolored stem ends or damaged portions. Slice the mushrooms thin (a food processor fitted with the thin-slicing disc makes short work of this task) and mix them thoroughly with the salt in a ceramic bowl. Cover mushrooms with a cloth and let them stand 24 hours, stirring occasionally. They will become very dark (the finished ketchup will be approximately the color of black bean soup).
At least an hour before the end of the salting period, combine the dried boletus mushrooms with the hot tap water; let them stand, covered, until completely soft.
Lift the soaked mushrooms from their liquid with a slotted spoon (this is to eliminate any grit that may be in the liquid) and place them in the container of a blender or food processor. Let soaking liquid settle for a minute or two, then carefully pour it over the mushrooms, stopping before any grit is poured out. Puree the soaked mushrooms, then pour the puree into a preserving pan. Without rinsing the blender container, puree the salted mushrooms; add this puree to that in the pan.
Place about 1/2 cup of the vinegar in the blender and add shallots and garlic; process them to a puree. Add this puree to the mixture in the pan, together with the rest of the vinegar, the allspice, cloves, mace, bay leaves, ginger and pepper. Bring the mixture to boiling over medium-high heat, lower heat, and simmer the ketchup, uncovered, stirring it often, for 1 to 1 1/2 hours, or until the tiny fragments of mushroom are very soft, almost jellylike, and the ketchup is thick. To test for correct consistency, pour a spoonful onto a saucer and let it stand 10 minutes, with the pot off the heat; if very little or no liquid seeps from the solids, the ketchup has thickened enough. If it does not pass this test, resume the cooking for as long as necessary.
Press ketchup through a sieve to remove the bay leaves and whole spices, then puree it again, in batches if necessary, in a blender or food processor, running the machine until the texture is velvety smooth.
Return ketchup to the rinsed-out pan and bring it to a full boil again over medium-high heat, stirring it constantly. Stir in the sherry.
Ladle the boiling-hot ketchup into hot, clean half-pint or pint canning jars, leaving 1/4" of headspace. Seal jars with new two-piece canning lids according to manufacturer's directions and process for 15 minutes (for either size jar) in a boiling-water bath. Cool, label and store the jars. Let ketchup mellow for a few weeks before serving it. Keeps for at least a year in a cool pantry.