Bring a large pot of salted water to a boil. Break the spaghetti strands in half and add them to the boiling water. Cook according to package instructions until al dente (usually 8-10 minutes). Do not overcook.
Drain the pasta immediately and rinse thoroughly under cold running water until the pasta is completely cool. This stops the cooking process and prevents the pasta from becoming sticky. Shake off excess water.
While the pasta cooks, prepare the vegetables. Seed and dice the cucumber and red bell pepper. Finely dice the red onion. Drain the corn if using canned.
In a small mixing bowl or jar, whisk together the mayonnaise, red wine vinegar, sugar, garlic powder, Italian seasoning, salt, and black pepper until smooth and creamy.
In a large salad bowl, combine the cooled spaghetti, corn, cucumber, red bell pepper, and red onion.
Pour the dressing over the pasta and vegetables. Toss gently but thoroughly with tongs until every strand of pasta is evenly coated.
Cover the bowl with plastic wrap and refrigerate for at least 1 hour before serving to allow the flavors to meld. Toss again right before serving.