What version of Ubuntu and Thunderbird are you using? Does this only happen on IMAP? Can you please test POP3? Does this happen with any other email addresses other than gmail?
What version of Ubuntu and Thunderbird are you using? Does this only happen on IMAP? Can you please test POP3? Does this happen with any other email addresses other than gmail?