msys.cloudmark.add_af_data

March 26, 2020 Contributors

Name

msys.cloudmark.add_af_data — Pass data for use with the Cloudmark ActiveFilter.

Synopsis

require('msys.cloudmark')

msys.cloudmark.add_af_data(addr, data)

addr: string
data: userdata (key-value pairs)

Description

Optionally pass the Cloudmark ActiveFilter an email address and a table of key-value pairs.

Note

You must load and correctly configure the cloudmark module and the maildir module before using this function. This function does not have a return value.

require("msys");
require("msys.extended.vctx");
require("msys.cloudmark");

local mod = {};
function mod:validate_rcptto(msg, rcptto_string, ac, vctx)
  local localpart = vctx:get(msys.core.VCTX_MESS, "rcptto_localpart");
  local domain = vctx:get(msys.core.VCTX_MESS, "rcptto_domain");
  msys.cloudmark.add_af_data(localpart .. "@" .. domain,
                             { custom_key = "custom_value" });
  return msys.core.VALIDATE_CONT;
end
msys.registerModule("af_test", mod);

See Also

msys.cloudmark.score_af, msys.cloudmark.set_af_mode_discard, msys.cloudmark.set_af_mode_keep, msys.cloudmark.set_af_mode_movemsg, msys.cloudmark.set_af_msi_address, msys.cloudmark.analyze, msys.cloudmark.score, “cloudmark – Cloudmark Authority® Content Scanning”