Take the sentence:
I speak all over to whoever will listen.
...at first blush, I thought, "Ah — whoever should be whomever."
However, I then noted that in the phrase "whoever will listen", whoever is correct.
I think the central issue is that if the sentence had ended without the "...will listen" then it would be correctly stated, "I speak all over to whomever." As it is, it seems like the last part of the sentence ("whoever will listen") ends up being the object of the 'to' rather than the single word: 'whoever'.
Is this sentence grammatically correct, and why?