Position an oven rack in the lower third of the oven and preheat to 375 degrees F.
Place the tomatoes on a rack in the sink in 1 layer. Sprinkle with the salt and allow to drain for 10 minutes.
Line the pie shell with foil and fill with pie weights, dried beans or rice. Bake in the lower third of the oven for 20 minutes. Carefully remove the weights and foil. Return to the oven and bake until light golden, 10 minutes more. Remove to cool in the pan on a wire rack.
Reduce the oven temperature to 350 degrees F. Heat the oil in a skillet over medium heat. Add the onions and season with salt and pepper. Cook until soft and translucent, 3 to 5 minutes. (Don't skip this step! Not cooking the onions will make the pie soggy and wet.)
Pat the tomato slices dry on both sides with paper towels. Layer the tomato slices, cooked onions and chopped herbs in the baked pie shell. Season each layer with pepper. Combine the grated cheeses and mayonnaise together. Spread the mixture on top of the tomatoes and bake until lightly browned, about 30 minutes. Remove to a rack to cool. Serve warm or at room temperature.