I've got a client who has experienced this intermittent symptom, and I'm looking for the cause:
Using Mail.app with GMail (enterprise edition), he presents Mail.app to me when it has an indeterminate progress indicator (spinning circle) next to the 'Sent' box. During this time, he can compose new messages and ask mail.app to send them, but they never leave his machine. I use Window > Connection Doctor > Show Detail to see IMAP commands and data flying by, but I can only see a few lines at a time, and have no way to scroll back to decipher what's going on.
The connection from Mail.app to GMail is encrypted, so I didn't think a packet capture would do what I wanted.
Is there a logging option that I can enable?
As an aside, I can clear this issue by deleting the (hidden) directory at ~/Library/Mail/IMAPemail@example.com/.OfflineCache/