def get_keytable_path(opendkim_conf):
    """Returns the path to the KeyTable file from the OpenDKIM config.
    """
    param = 'KeyTable'

    with open(opendkim_conf, 'r') as f:
        for line in f:
            if line.startswith(param):
                return line.replace(param, '').strip()

    msg = "Could not find '{}' parameter in OpenDKIM config at {}".format(param, opendkim_conf)
    raise RuntimeError(msg)