'Returns appropriate IMAP port number depending on incoming server name'

def get_imap_port(self):

    port = 143
    ssl = False
    if (self.incoming_server_type == 'IMAP-SSL'):
        port = 993
        ssl = True
    return (port, ssl)
