Cook the spaghetti al dente as described on the package.
Meanwhile, peel and chop the onion, cut the feta into small cubes and the ham into thin strips. Chop the sun-dried tomatoes and olives. Mix everything in a bowl and add a little olive oil. If you want, you can squeeze a clove of garlic into the mixture.
Drain the finished spaghetti and add to the mixture. Season to taste with salt and pepper. Feta and ham already bring salt, so only use a little salt.
The dish is eaten hot or lukewarm, but also tastes cold as a Mediterranean salad.