Some mail servers require you to connect on a certain port. Evolution (the default mail client for the gnome desktop environment) doesn’t have a setting for the server port number. You can set this by adding :[port_no] to the end of the server address.
For example, to use the mail server mail.example.com on port 587, set the server path as mail.example.com:587.