Rinse dried navy beans in cold water, pick over to remove foreign particles, and soak covered in water overnight. Drain beans and place them in a large saucepan with 2 1/2 quarts water, bay leaves, and salt pork.
Bring to a boil, reduce heat, and simmer, covered, until tender, 1 to 1 1/2 hours, adding water if necessary. (If using canned beans, the above step is unnecessary, since beans are already cooked.)
In a medium-size skillet, heat olive oil and saute onion, green pepper, garlic, oregano, ham, and tomato sauce for 10 minutes. In a separate saucepan, boil squash chunks for 5 minutes. Remove from water, adding same water to tomato mixture. Peel squash.
When beans are tender, add tomato mixture, potato, salt, pepper, and squash. Continue cooking another 30 minutes. Remove salt pork and discard. Serve in soup bowls. Serves 6.