Shatner has said that fan mail was handled by staff assistants, who even signed the supposed autographs, and he never (more or less) even saw it. And he was not aware of Nimoy being more popular than him. OTOH, there is anecdotal evidence that he was protective of Kirk's line count. He didn't want to gradually slide into supporting status if Spock was trending.
Popularity is not measured by fan mail alone, though. Fan magazines, interview requests, award nominations, overall response with thigs like "I Grok Spock" all factor into it. Shatner didn't live in a bubble and even if he did, I'm sure the actor noticed the guy who was downplayed at the start of the show was becoming more prominent. Spock had two full episodes in one season devoted to his background. We met Kirk's dead brother who was never mentioned after he died. There was never a story about Kirk's background other than "his father helped me get into the academy" sort of thing.
Don't let him fool ya, he knew.