rcpt_map - check recipients against recipient map
rcpt_map reads a list of adresses, return codes and comments from the supplied config file. Adresses are 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.
When the given map file changes on disk, it is re-read in the pre-connection hook.
file MAP and
domain NAME arguments are required.
The default value of the
default argument is
DENY=No_such_user. (see below why
- domain NAME
If the recipient address does not match this domain name NAME, this plugin will return
- file MAP
Use the config file as map file, format as explained below
- default CODE[=MSG]
Use CODE as default return code (and return MSG as message) if a recipient was not found in the map. Since we can't use spaces in MSG, every
_is replaced by a space, i.e. use
DENY=User_not_foundif you want a deny message
User not found.
The config file contains lines with an address, a return code and a comment, which will be returned to the sender, if the code is not OK or DECLINED. Example:
# example_org_map - config for rcpt_map plugin firstname.lastname@example.org OK email@example.com OK firstname.lastname@example.org DENY User not found.
We're currently running this plugin like shown in the following example.
Excerpt from the
plugins config file:
## list of valid users, config in /srv/qpsmtpd/config/rcpt_regexp ## ... except for "*@example.org": rcpt_regexp ## only for "@example.org": rcpt_map domain example.org file /srv/qpsmtpd/config/map_example_org
rcpt_regexp config file:
### "example.org" addresses are checked later by the rcpt_map ### plugin, return DECLINED here: /^.*\@example\.org$/ DECLINED ### all other domains just check for valid users, the validity ### of the domain is checked by the rcpt_ok plugin => never use ### something else than "DENY" or "DECLINED" here! /^(abuse|postmaster)\@/ DECLINED /^(me|you)\@/ DECLINED /^.*$/ DENY No such user.
Copyright (c) 2009 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.