Qpsmtpd:rcpt regexp

From SME Server
Jump to navigation Jump to search

Qpsmtpd#Plugins

NAME

rcpt_regexp - check recipients against a list of regular expressions

DESCRIPTION

rcpt_regexp reads a list of regular expressions, return codes and comments from the rcpt_regexp config file. If the regular expression does NOT match m#^(/.*/)$#, it is used as a string which is compared with eq lc($rcpt). The recipient addresses are checked against this list, and if the first matches, the return code from that line and the comment are returned to qpsmtpd. Return code can be any valid plugin return code from Qpsmtpd::Constants. Matching is always done case insenstive.

CONFIG FILE

The config file rcpt_regexp contains lines with a perl RE, including the "/"s, a return code and a comment, which will be returned to the sender, if the code is not OK or DECLINED. Example:

  # rcpt_regexp - config for rcpt_regexp plugin
  me@myhost.org           OK       Accepting mail
  /^user\d+\@doma\.in$/   OK       Accepting mail
  info@myhost.com         DENY     User not found.
  /^unused\@.*/           DENY     User not found.
  /^.*$/                  DECLINED Fall through to next rcpt plugin

NOTE

The rcpt_regexp config file should be writeable by trusted users only: the regexes are compiled with eval().

COPYRIGHT AND LICENSE

Copyright (c) 2005 Hanno Hecker

This plugin is licensed under the same terms as the qpsmtpd package itself. Please see the LICENSE file included with qpsmtpd for details.