Consider the following two commands:
create-smtp-message | ssh -p 25 serveraccount
create-smtp-message | ssh serveraccount telnet localhost 25
According to my understanding of ssh(1), they should both do the same thing. Instead, the second will send the output of create-smtp-message to port 25 of the server from serveraccount (i.e., it works), whilst the first just hangs.
I'm guessing this is just me misunderstanding what ssh does when it is given the -p flag, but in case there is some configuration error: the client at which analogous commands were issued is osx-tiger with openssh ssh (OpenSSH_5.1p1, OpenSSL 0.9.7l 28 Sep 2006), the server runs a Debian Sarge (really? must upgrade that!) with openssh sshd (OpenSSH_3.8.1p1 Debian-8.sarge.6, OpenSSL 0.9.7e 25 Oct 2004). Authorisation is using DSA, as specified in the .ssh/config file.