Port 22 is for ssh communication. If you really want telnet (never do this if your accessing systems on the Internet) then use port 21.
But as you are on a linux box, why not use the 'ssh' client command? It's there or if not, it's easily installed. just type
But you're testing your mail server, right? (just skimming though your posting)
Then you should use
telnet localhost 25