Skip to main content

msys.bounce.classify_smtp_response

Last updated March 2020

Name

msys.bounce.classify_smtp_response — Create a bounce classification from SMTP response text and the domain name

Synopsis

msys.bounce.classify_smtp_response(response_text, domain);

response_text: string
domain: string

Description

This function takes the SMTP response text and the domain name as input and returns a tuple (code, code_string, description). code is a numerical classification code; code_string is the string representation of the code; description is the textual description of the code. The bounce_classifier_override module must be configured for this function to produce the correct result.

Enable this function with the statement require('msys.bounce');.

require("msys.bounce");

local mod = {};

function mod:validate_data_spool(msg, accept, vctx)
  code, name, desc, rcpts = msys.bounce.classify(msg);
  print("msys.bounce.classify: code = ", code, " symbol = ", name, " desc = ", desc, " orig rcpt: ", rcpts);
  code, name, desc = msys.bounce.classify_smtp_response("this domain is no longer used");
  print("msys.bounce.classify_smtp_response: code = ", code, " symbol = ", name, " desc = ", desc );
  return msys.core.VALIDATE_CONT;
end

msys.registerModule("test_bc", mod);

See Also

Was this page helpful?