SSH Tunnel to bypass firewall on IMAP port


I use gmail for work, but prefer to use Sparrow on my macbook as opposed to the web interface. The problem is that the wifi I use most often has a pretty locked down firewall. Specifically it blocks the port that Gmail uses for IMAP so I can’t check my email when connected. I’m looking for the simpliest way to get around this. It seems as though using a SSH tunnel would be the best way, and I think that’s possible using my Dreamhost account. What I’m looking for are specific instructions on how to set it up, both on the Dreamhost side of things and then also on my Macbook.