Are you running Thunderbird / telnet-ing from the same computer that osTicket is running on? Because if you are not it not a good test. The error specifically says "Connection refused", which generally means there is a firewall in play that is blocking the traffic, or the remote server has not been configured to allow access from the server that is running osTicket.