def build_ldap_uri(config, node=''):
    """ Building LDAP uris for dovecot conf """
    if node:
        node += '_'
    return '{}://{}:{}'.format('ldaps' if config['ldap_secured'] == 'ssl' else
        'ldap', config['ldap_{}server_address'.format(node)], config[
        'ldap_{}server_port'.format(node)])
