I know it's quite basic, but I always get confused between a direct tunnel and a socks tunnel.
So here it is, for later reference:
ssh -N email@example.com -L 5000/chat.facebook.com/5222
tunnels requests to localhost:5000 to chat.facebook.com:5222. This is a static tunnel. The following is a generic tunnel:
ssh -ND 8888 firstname.lastname@example.org
This dynamic tunnel (
-D) can be used as socks 4 or 5 proxy and thus tunnel every request.