FILTER-REGEX.CONF(5)

NAME
filter-regex.conf - filter-regex configuration file

DESCRIPTION
filter-regex.conf is the configuration file for filter-regex(8).

The file consists of rules that, when matched, cause filter-regex(8) to reject mails.

The current line can be extended over multiple lines using a trailing backslash (‘\’). Comments can be put anywhere in the file using a hash mark (‘#’), and extend to the end of the current line. Emtpy lines and lines starting with ‘#’ are ignored, as well as leading whitespaces.

The syntax of filter-regex.conf is described below.

    connect []! <hostname> Reject the connection if the connection sender's hostname matches the specified regular expressions.

    helo []! <name> Reject the connection if the sender supplied HELO name matches the specified regular expression.

    mail []! <address> Reject the mail if the sender supplied MAIL FROM address matches the specified regular expression.

    rcpt []! <address> Reject the mail if the sender supplied RCPT TO address matches the specified regular expression.

    dataline []! <line> Reject the mail if a data (header or body) line matches the specified regular expression.

REGULAR EXPRESSIONS
The regular expressions used in the configuration rules do not need further escaping.

The optional ‘’! character in front of the regular expression (separated by a whitespace) reverses the matching result and causes the rule, when matched, to be accepted. This is considered a negotiation and break operation, thus allows exceptions to the actual rejection rules.

All subsequent argument characters up to the end of the line are taken literally as the regular expression.

See re_format(7) for a detailed description of basic and extended regular expressions.

EXAMPLES
The default filter-regex.conf file which ships with OpenSMTPD-extras contains commented examples.

FILES
/etc/mail/filter-regex.conf
    Default filter-regex.conf configuration file.

SEE ALSO
filter-regex(8), filter_api(3), smtpd.conf(5), smtpd(8), re_format(7), regex(3)

HISTORY
The first version of filter-regex(8) was written in 2015.

AUTHORS
filter-regex(8) was intially written by Armin Wolfermann <armin@wolfermann.org> and further improved by Joerg Jung <jung@openbsd.org>.