.\" $OpenBSD: $ .\" .\" Copyright (c) 2015, Joerg Jung .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: May 15 2015 $ .Dt FILTER-REGEX 8 .Os .Sh NAME .Nm filter-regex .Nd smtpd filter for regular expression filtering .Sh SYNOPSIS .Nm .Op Fl l Ar limit .Op Ar file .Sh DESCRIPTION .Nm is a filter for .Xr smtpd 8 which can be used to filter mails using regular expressions matching SMTP session parameters. .Pp The options are as follows: .Bl -tag -width "-l limit" .It Fl l Ar limit Set the number of lines .Ar limit of .Nm after which the regular expression processing is stopped and the mail is accepted. The accepted values are within the range of 1 and UINT_MAX. .Pp The default .Ar limit value is 0 (unlimited). .El .Pp Depending if one of the regular expressions matches mails are either accepted or rejected with a SMTP 554 reply. Non-matching mails are always accepted. .Sh FILES .Bl -tag -width "/etc/mail/filter-regex.conf" -compact .It Pa /etc/mail/filter-regex.conf Default .Nm configuration file. .El .Sh SEE ALSO .Xr filter-regex.conf 5 , .Xr filter_api 3 , .Xr smtpd.conf 5 , .Xr smtpd 8 , .Xr re_format 7 , .Xr regex 3 .Sh HISTORY The first version of .Nm was written in 2015. .Sh AUTHORS .Nm was intially written by .An Armin Wolfermann Aq Mt armin@wolfermann.org and further improved by .An Joerg Jung Aq Mt jung@openbsd.org .