Sprinkle the aubergines and courgettes with salt, then place them in a colander with a plate and a weight on top to extract the bitter juices and excess water. Leave to stand for about 30 minutes.
Heat the oil in a large heavy pan. Add the onions, sweat gently for 6–7 minutes until just softened, then add the garlic and sweat for another 2 minutes.
Rinse the aubergines and courgettes, and pat dry with kitchen paper. Add to the pan with the peppers, increase the heat and sauté until the peppers are just turning brown. Add the herbs and coriander seeds, then cover the pan and cook gently for about 40 minutes.
Add the tomatoes and season well with salt and pepper. Cook gently for 10 minutes until the vegetables are soft but not too mushy.
Remove the herb sprigs. Stir in the basil leaves, and check the seasoning. Serve hot.