I suspect this post has more to do with Mail.app than ssh-tunneling.
Anyway, I set up a tunnel like this:
> ssh -L5525:my-smtp.server.com:25 my-ssh.server.com
I test the tunnel using
> telnet 127.0.0.1 5525
and it connects just fine. The thing is, I can't get Mail.app to connect. I've set 127.0.0.1 as host using port 5525, but Mail.app complains about the server not supporting authentication.
I set the mailserver up myself, so authenticating shouldn't be the problem.