The description of an action in the chainmail configuration file consists of a keyword - action name - followed by zero, one or several quoted strings - action parameters. Note that parameters must by double-quoted and separated by blanks.
Chainmail knows about the following actions:
AddRcpt "address". Add recipient "address" to the message.
Example:
AddRcpt "manager@mycompany.com"
DelRcpt "address". Remove recipient "address" from message. If "address" was not among the message recipients, nothing happens.
Example:
DelRcpt "badguy@mycompany.com"
Reject "code" "enh_code" "reply". Reject the message. All the three parameters are optional and may be omitted. If the "code" parameter is given, it must be a valid SMTP status code (three digits starting with 5). If the "enh_code" parameter is given it must be valid SMTP enhanced status code (as defined in RFC1893). If the "reply" parameter is given, it will be used as SMTP reply text. Note that if any of the tree parameters is given, but is am empty string (""), the default value will be used, as if the parameter as not given.
Examples:
Reject with generic code and message:
Reject
Reject with custom codes and message:
Reject "550" "5.7.1" "This message violates our policy"
Tempfail "code" "enh_code" "reply". Temporarily fail the message. This differs from Reject action in that rejected message will not be resent again, while temporarily failed message will be resend again later. The meaning of the parameters is the same. The "code" parameter, is given, must start with digit 4.
Examples:
Temporarily fail with generic code and message:
Tempfail
Temporarily fail with custom codes and message:
Tempfail "451" "4.7.1" "The system is down for maintenance, contact support"
Discard. Discard the message. The message will be silently dropped, without indicating any error to the message sender.
Accept. Accept the message immediately without trying any further chainmail rules.