Keep waiting until there's something to read from the mail server - some mail servers have a delay between connection and when they send the welcome banner.