]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.0.7 v2.0.7
authorWietse Venema <wietse@porcupine.org>
Wed, 19 Mar 2003 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 15:51:45 +0000 (15:51 +0000)
20 files changed:
postfix/HISTORY
postfix/conf/master.cf
postfix/html/proxymap.8.html
postfix/html/uce.html
postfix/man/man8/proxymap.8
postfix/src/global/Makefile.in
postfix/src/global/mail_version.h
postfix/src/global/maps.c
postfix/src/global/tok822_parse.c
postfix/src/master/mail_flow.c
postfix/src/postsuper/postsuper.c
postfix/src/proxymap/proxymap.c
postfix/src/smtpd/smtpd.c
postfix/src/smtpd/smtpd.h
postfix/src/smtpd/smtpd_check.c
postfix/src/smtpd/smtpd_check.h
postfix/src/smtpd/smtpd_check.in4
postfix/src/smtpd/smtpd_check.ref4
postfix/src/smtpd/smtpd_check_access
postfix/src/smtpd/smtpd_state.c

index c882f46ad61a5fa6c8854e11cc9b5dcb41ae1a2c..283e48572b99d2d12420f8d6d3906f84282655e5 100644 (file)
@@ -7682,6 +7682,24 @@ Apologies for any names omitted.
        systems against exploitation of the remote buffer overflow
        vulnerability described in CERT advisory CA-2003-07.
 
+20030311-19
+
+       Bugfix: the access map actions HOLD, DISCARD and FILTER
+       were broken with smtpd_delay_reject=no and with ETRN. Fixing
+       this required re-architecting of the actions code. Files:
+       smtpd/smtpd.[hc], smtpd/smtpd_check.c, smtpd/smtpd_state.c.
+
+20030315
+
+       Bugfix: the postsuper manual page documented support for
+       the -c command line option, but it was not implemented.
+       File: postsuper/postsuper.c.
+
+       Bugfix: the Postfix 2.0 recipient map checking code broke
+       the VRFY command, causing it to reply with status code 252
+       for non-existent addresses. This required re-architecting
+       the recipient table lookup code. File:  smtpd/smtpd_check.c.
+
 Open problems:
 
        Low: after successful delivery, per-queue window += 1/window,
index eb9960c2f28bf8c860e5ad0e0f8a77bceb280f43..80857d088497a341575d2337a38fc4e36f6c30d3 100644 (file)
@@ -26,6 +26,8 @@
 # directory (pathname is controlled by the queue_directory configuration
 # variable in the main.cf file). Presently, all Postfix daemons can run
 # chrooted, except for the pipe, virtual and local delivery daemons.
+# The proxymap server can run chrooted, but doing so defeats most of
+# the purpose of having that service in the first place.
 # The files in the examples/chroot-setup subdirectory describe how
 # to set up a Postfix chroot environment for your type of machine.
 #
index 4ea05c0960300511f3bdb7489fad7bf2513e03b3..0cff6e6a62551ca229fffdb87d151689e713bd8d 100644 (file)
@@ -88,7 +88,9 @@ PROXYMAP(8)                                           PROXYMAP(8)
        The  proxymap  server  opens only tables that are approved
        via the <b>proxy</b><i>_</i><b>read</b><i>_</i><b>maps</b> configuration parameter, does  not
        talk  to  users,  and  can  run  at  fixed  low privilege,
-       chrooted or not.
+       chrooted or not.  However,  running  the  proxymap  server
+       chrooted  severely  limits  usability, because it can open
+       only chrooted tables.
 
        The proxymap server is not a trusted daemon  process,  and
        must  not be used to look up sensitive information such as
index 03055c96381f3b2cdb573fec55aa145a89e4d28a..9cc939967a31312275d26c21af6f46f2408ca894 100644 (file)
@@ -856,7 +856,7 @@ and the address contains no sender-specified routing
 <li>Postfix is the final destination:  any destination that matches
 <a href="basic.html#mydestination">$mydestination</a>, <a
 href="basic.html#inet_interfaces">$inet_interfaces</a>, <a
-href="virtual.5.html">$virtual_alias_domains</a>, or
+href="virtual.5.html">$virtual_alias_domains</a>, or <a
 href="virtual.8.html">$virtual_mailbox_domains</a>.
 
 </ul>
index a801de872740a253ec51bddcfda5b0526aed3add..73efb71428b0b606b2b72dbb7077e9af20507fd1 100644 (file)
@@ -88,6 +88,8 @@ of idle time.
 The proxymap server opens only tables that are approved via the
 \fBproxy_read_maps\fR configuration parameter, does not talk to
 users, and can run at fixed low privilege, chrooted or not.
+However, running the proxymap server chrooted severely limits
+usability, because it can open only chrooted tables.
 
 The proxymap server is not a trusted daemon process, and must
 not be used to look up sensitive information such as user or
index a981d06f9783e7acb8d275b45272b115f1196686..8f48d059fd831bf61a0e0d0cca71262ea7d833e9 100644 (file)
@@ -1210,6 +1210,7 @@ tok822_parse.o: ../../include/sys_defs.h
 tok822_parse.o: ../../include/vstring.h
 tok822_parse.o: ../../include/vbuf.h
 tok822_parse.o: ../../include/msg.h
+tok822_parse.o: ../../include/stringops.h
 tok822_parse.o: lex_822.h
 tok822_parse.o: quote_822_local.h
 tok822_parse.o: quote_flags.h
index 05fb9d28bbe45a8315ee8c662aef794fc887d641..d3ee7e8c207e4d3708c0821758688f0b689de316 100644 (file)
   * Patches change the patchlevel and the release date. Snapshots change the
   * release date only, unless they include the same bugfix as a patch release.
   */
-#define MAIL_RELEASE_DATE      "20030305"
+#define MAIL_RELEASE_DATE      "20030319"
 
 #define VAR_MAIL_VERSION       "mail_version"
-#define DEF_MAIL_VERSION       "2.0.6"
+#define DEF_MAIL_VERSION       "2.0.7"
 extern char *var_mail_version;
 
  /*
index 82edbb0ccb66c195aa9fe39a145478f5dddeb554..6b0fa6269a4b8d43c4a86d6dc6ee982cb3541b8c 100644 (file)
@@ -184,14 +184,15 @@ const char *maps_find(MAPS *maps, const char *name, int flags)
            continue;
        if ((expansion = dict_get(dict, name)) != 0) {
            if (msg_verbose)
-               msg_info("%s: %s: %s = %s", myname, *map_name, name, expansion);
+               msg_info("%s: %s: %s: %s = %s", myname, maps->title,
+                        *map_name, name, expansion);
            return (expansion);
        } else if (dict_errno != 0) {
            break;
        }
     }
     if (msg_verbose)
-       msg_info("%s: %s: %s", myname, name, dict_errno ?
+       msg_info("%s: %s: %s: %s", myname, maps->title, name, dict_errno ?
                 "search aborted" : "not found");
     return (0);
 }
index fe554bf7ae2f8015287b5cc72e1c665cdf8348cd..4866ac5ad3db2dd5a5d763dc7e05436ca5c8e5fa 100644 (file)
 
 #include <vstring.h>
 #include <msg.h>
+#include <stringops.h>
 
 /* Global library. */
 
@@ -250,7 +251,7 @@ static void strip_address(VSTRING *vp, int start, TOK822 *addr)
      * Emit plain <address>. Discard any comments or phrases.
      */
     msg_warn("stripping too many comments from address: %.100s...",
-            vstring_str(vp) + start);
+            printable(vstring_str(vp) + start, '?'));
     vstring_truncate(vp, start);
     VSTRING_ADDCH(vp, '<');
     if (addr) {
@@ -263,7 +264,6 @@ static void strip_address(VSTRING *vp, int start, TOK822 *addr)
     VSTRING_ADDCH(vp, '>');
 }
 
-
 /* tok822_externalize - token tree to string, external form */
 
 VSTRING *tok822_externalize(VSTRING *vp, TOK822 *tree, int flags)
index efb59885409a7ee61ed460102142645035a6bdf8..383ba5816c5a9e454d1765c0d1b812e6c934e9ee 100644 (file)
@@ -47,6 +47,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 #include <stdlib.h>
+#include <string.h>
 
 /* Utility library. */
 
index 7c318f90bd52759195116ea761acc3edf38b9f40..d8831fc26c23dc145f56a613ee1327758c312750 100644 (file)
@@ -985,16 +985,13 @@ int     main(int argc, char **argv)
            msg_fatal("open /dev/null: %m");
 
     /*
-     * Process environment options as early as we can. We might be called
-     * from a set-uid (set-gid) program, so be careful with importing
-     * environment variables.
+     * Process this environment option as early as we can, to aid debugging.
      */
     if (safe_getenv(CONF_ENV_VERB))
        msg_verbose = 1;
 
     /*
-     * Initialize. Set up logging, read the global configuration file and
-     * extract configuration information.
+     * Initialize logging.
      */
     if ((slash = strrchr(argv[0], '/')) != 0)
        argv[0] = slash + 1;
@@ -1002,47 +999,37 @@ int     main(int argc, char **argv)
     msg_syslog_init(mail_task(argv[0]), LOG_PID, LOG_FACILITY);
     set_mail_conf_str(VAR_PROCNAME, var_procname = mystrdup(argv[0]));
 
-    mail_conf_read();
-    if (chdir(var_queue_dir))
-       msg_fatal("chdir %s: %m", var_queue_dir);
-
     /*
-     * Be sure to log a warning if we do not finish structural repair. Maybe
-     * we should have an fsck-style "clean" flag so Postfix will not start
-     * with a broken queue.
-     */
-    signal(SIGHUP, interrupted);
-    signal(SIGINT, interrupted);
-    signal(SIGQUIT, interrupted);
-    signal(SIGTERM, interrupted);
-    msg_cleanup(fatal_exit);
-
-    /*
-     * All file/directory updates must be done as the mail system owner. This
-     * is because Postfix daemons manipulate the queue with those same
-     * privileges, so directories must be created with the right ownership.
-     * 
-     * Running as a non-root user is also required for security reasons. When
-     * the Postfix queue hierarchy is compromised, an attacker could trick us
-     * into entering other file hierarchies and afflicting damage. Running as
-     * a non-root user limits the damage to the already compromised mail
-     * owner.
+     * Disallow unsafe practices, and refuse to run set-uid (or as the child
+     * of a set-uid process). Whenever a privileged wrapper program is
+     * needed, it must properly sanitize the real/effective/saved UID/GID,
+     * the secondary groups, the process environment, and so on. Otherwise,
+     * accidents can happen. If not with Postfix, then with other software.
      */
+    if (unsafe() != 0)
+       msg_fatal("this postfix command must not run as a set-uid process");
     if (getuid())
        msg_fatal("use of this command is reserved for the superuser");
-    set_ugid(var_owner_uid, var_owner_gid);
 
     /*
      * Parse JCL.
      */
-    while ((c = GETOPT(argc, argv, "d:h:H:pr:sv")) > 0) {
+    while ((c = GETOPT(argc, argv, "c:d:h:H:pr:sv")) > 0) {
        switch (c) {
        default:
-           msg_fatal("usage: %s [-d queue_id (delete)] "
+           msg_fatal("usage: %s "
+                     "[-c config_dir] "
+                     "[-d queue_id (delete)] "
                      "[-h queue_id (hold)] [-H queue_id (un-hold)] "
                      "[-p (purge temporary files)] [-r queue_id (requeue)] "
                      "[-s (structure fix)] [-v (verbose)] "
                      "[queue...]", argv[0]);
+       case 'c':
+           if (*optarg != '/')
+               msg_fatal("-c requires absolute pathname");
+           if (setenv(CONF_ENV_PATH, optarg, 1) < 0)
+               msg_fatal("setenv: %m");
+           break;
        case 'd':
            if (delete_names == 0)
                delete_names = argv_alloc(1);
@@ -1083,6 +1070,42 @@ int     main(int argc, char **argv)
        }
     }
 
+    /*
+     * Read the global configuration file and extract configuration
+     * information. The -c command option can override the default
+     * configuration directory location.
+     */
+    mail_conf_read();
+    if (chdir(var_queue_dir))
+       msg_fatal("chdir %s: %m", var_queue_dir);
+
+    /*
+     * All file/directory updates must be done as the mail system owner. This
+     * is because Postfix daemons manipulate the queue with those same
+     * privileges, so directories must be created with the right ownership.
+     * 
+     * Running as a non-root user is also required for security reasons. When
+     * the Postfix queue hierarchy is compromised, an attacker could trick us
+     * into entering other file hierarchies and afflicting damage. Running as
+     * a non-root user limits the damage to the already compromised mail
+     * owner.
+     */
+    set_ugid(var_owner_uid, var_owner_gid);
+
+    /*
+     * Be sure to log a warning if we do not finish structural repair. Maybe
+     * we should have an fsck-style "clean" flag so Postfix will not start
+     * with a broken queue.
+     * 
+     * Set up signal handlers after permanently dropping super-user privileges,
+     * so that signal handlers will always run with the correct privileges.
+     */
+    signal(SIGHUP, interrupted);
+    signal(SIGINT, interrupted);
+    signal(SIGQUIT, interrupted);
+    signal(SIGTERM, interrupted);
+    msg_cleanup(fatal_exit);
+
     /*
      * Sanity checks.
      */
index 362079da2038dbda3ab6b91a875f0ab28e1900a1..fd93a8275856a2f4e937af4f8e6d4766bec8cec5 100644 (file)
@@ -78,6 +78,8 @@
 /*     The proxymap server opens only tables that are approved via the
 /*     \fBproxy_read_maps\fR configuration parameter, does not talk to
 /*     users, and can run at fixed low privilege, chrooted or not.
+/*     However, running the proxymap server chrooted severely limits
+/*     usability, because it can open only chrooted tables.
 /*
 /*     The proxymap server is not a trusted daemon process, and must
 /*     not be used to look up sensitive information such as user or
index 185ddd22777395a731eb00f2d63b605c5445ed34..f4cd07788d95bf904407b15938c8f3f11f5c8486 100644 (file)
@@ -893,6 +893,7 @@ static void mail_reset(SMTPD_STATE *state)
     if (var_smtpd_sasl_enable)
        smtpd_sasl_mail_reset(state);
 #endif
+    state->discard = 0;
 }
 
 /* rcpt_cmd - process RCPT TO command */
@@ -951,10 +952,6 @@ static int rcpt_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
            smtpd_chat_reply(state, "%s", err);
            return (-1);
        }
-       if ((err = smtpd_check_rcptmap(state, argv[2].strval)) != 0) {
-           smtpd_chat_reply(state, "%s", err);
-           return (-1);
-       }
     }
 
     /*
@@ -1259,7 +1256,7 @@ static int vrfy_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
        return (-1);
     }
     if (SMTPD_STAND_ALONE(state) == 0
-       && (err = smtpd_check_rcptmap(state, argv[1].strval)) != 0) {
+       && (err = smtpd_check_rcpt(state, argv[1].strval)) != 0) {
        smtpd_chat_reply(state, "%s", err);
        return (-1);
     }
index 8be9efef126085a6ebf93b2ad7ba71577c7508bb..a369b7e8603abae1d5cbeb6925777f733d03c77f 100644 (file)
@@ -93,6 +93,7 @@ typedef struct SMTPD_STATE {
     int     defer_if_permit_client;    /* force permit into warning */
     int     defer_if_permit_helo;      /* force permit into warning */
     int     defer_if_permit_sender;    /* force permit into warning */
+    int     discard;                   /* discard message */
     VSTRING *expand_buf;               /* scratch space for $name expansion */
 } SMTPD_STATE;
 
index 678a86f0b04101be5cbc11a8a0cf83a27d3b33ef..b423330820a9ccfbb77f9b8766d3d31fc6e3b8d7 100644 (file)
 /*     SMTPD_STATE *state;
 /*     char    *recipient;
 /*
-/*     char    *smtpd_check_rcptmap(state, recipient)
-/*     SMTPD_STATE *state;
-/*     char    *recipient;
-/*
 /*     char    *smtpd_check_etrn(state, destination)
 /*     SMTPD_STATE *state;
 /*     char    *destination;
 /* .IP smtpd_recipient_restrictions
 /*     Restrictions on the recipient address that is sent with the RCPT
 /*     TO command.
-/* .PP
-/*     smtpd_check_rcptmap() validates the recipient address provided
-/*     with an RCPT TO request and sets the rcptmap_checked flag.
-/*     Relevant configuration parameters:
-/* .IP local_recipients_map
+/* .IP local_recipient_maps
 /*     Tables of user names (not addresses) that exist in $mydestination.
 /*     Mail for local users not in these tables is rejected.
 /* .PP
@@ -1622,6 +1614,31 @@ static int reject_unknown_address(SMTPD_STATE *state, const char *addr,
     return (reject_unknown_mailhost(state, domain, reply_name, reply_class));
 }
 
+/* warn_skip_access_action - FILTER etc. action in unsupported context */
+
+static void warn_skip_access_action(const char *table, const char *action,
+                                           const char *reply_class)
+{
+
+    /*
+     * Warn only about FILTER/HOLD/etc. access table actions that appear in
+     * restrictions where they will always be ignored.
+     */
+    if (strcmp(reply_class, SMTPD_NAME_CLIENT) == 0
+       || strcmp(reply_class, SMTPD_NAME_HELO) == 0
+       || strcmp(reply_class, SMTPD_NAME_SENDER) == 0) {
+       if (var_smtpd_delay_reject == 0)
+           msg_warn("access table %s: with %s=%s, "
+                    "action %s is always skipped in %s restrictions",
+                    table, VAR_SMTPD_DELAY_REJECT, CONFIG_BOOL_NO,
+                    action, reply_class);
+    } else {
+       msg_warn("access table %s: action %s is always "
+                "skipped in %s restrictions",
+                table, action, reply_class);
+    }
+}
+
 /* check_table_result - translate table lookup result into pass/reject */
 
 static int check_table_result(SMTPD_STATE *state, const char *table,
@@ -1673,6 +1690,12 @@ static int check_table_result(SMTPD_STATE *state, const char *table,
      * mind, and reject/discard the message for other reasons.
      */
     if (STREQUAL(value, "FILTER", cmd_len)) {
+#ifndef TEST
+       if (state->dest == 0) {
+           warn_skip_access_action(table, "FILTER", reply_class);
+           return (SMTPD_CHECK_DUNNO);
+       }
+#endif
        if (*cmd_text == 0) {
            msg_warn("access map %s entry \"%s\" has FILTER entry without value",
                     table, datum);
@@ -1697,6 +1720,12 @@ static int check_table_result(SMTPD_STATE *state, const char *table,
      * reject/discard the message for other reasons.
      */
     if (STREQUAL(value, "HOLD", cmd_len)) {
+#ifndef TEST
+       if (state->dest == 0) {
+           warn_skip_access_action(table, "HOLD", reply_class);
+           return (SMTPD_CHECK_DUNNO);
+       }
+#endif
        vstring_sprintf(error_text, "<%s>: %s %s", reply_name, reply_class,
                        *cmd_text ? cmd_text : "triggers HOLD action");
        log_whatsup(state, "hold", STR(error_text));
@@ -1709,17 +1738,21 @@ static int check_table_result(SMTPD_STATE *state, const char *table,
 
     /*
      * DISCARD means silently discard and claim successful delivery.
-     * 
-     * XXX Set some global flag that disables all further restrictions.
-     * Triggering a "reject" or "hold" action after "discard" is silly.
      */
     if (STREQUAL(value, "DISCARD", cmd_len)) {
+#ifndef TEST
+       if (state->dest == 0) {
+           warn_skip_access_action(table, "DISCARD", reply_class);
+           return (SMTPD_CHECK_DUNNO);
+       }
+#endif
        vstring_sprintf(error_text, "<%s>: %s %s", reply_name, reply_class,
                        *cmd_text ? cmd_text : "triggers DISCARD action");
        log_whatsup(state, "discard", STR(error_text));
 #ifndef TEST
        rec_fprintf(state->dest->stream, REC_TYPE_FLGS, "%d",
                    CLEANUP_FLAG_DISCARD);
+       state->discard = 1;
 #endif
        return (SMTPD_CHECK_OK);
     }
@@ -2548,6 +2581,9 @@ static int generic_checks(SMTPD_STATE *state, ARGV *restrictions,
 
     for (cpp = restrictions->argv; (name = *cpp) != 0; cpp++) {
 
+       if (state->discard != 0)
+           break;
+
        if (msg_verbose)
            msg_info("%s: name=%s", myname, name);
 
@@ -2998,10 +3034,7 @@ char   *smtpd_check_rcpt(SMTPD_STATE *state, char *recipient)
 
     /*
      * The "check_recipient_maps" restriction is relevant only when
-     * responding to RCPT TO. It's effectively disabled with DATA (recipient
-     * context is explicitly turned off) and not applicable with undelayed
-     * client/helo/sender restrictions (no recipient info) or with ETRN
-     * (command not allowed in the middle of an ongoing MAIL transaction).
+     * responding to RCPT TO or VRFY.
      */
     state->rcptmap_checked = 0;
 
@@ -3027,7 +3060,7 @@ char   *smtpd_check_rcpt(SMTPD_STATE *state, char *recipient)
     SMTPD_CHECK_RESET();
     status = setjmp(smtpd_check_buf);
     if (status == 0 && rcpt_restrctions->argc)
-           status = generic_checks(state, rcpt_restrctions,
+       status = generic_checks(state, rcpt_restrctions,
                          recipient, SMTPD_NAME_RECIPIENT, CHECK_RECIP_ACL);
 
     /*
@@ -3038,6 +3071,14 @@ char   *smtpd_check_rcpt(SMTPD_STATE *state, char *recipient)
        status = smtpd_check_reject(state, state->defer_if_permit.class,
                                  "%s", STR(state->defer_if_permit.reason));
 
+    /*
+     * If the "check_recipient_maps" restriction was not applied, and if mail
+     * is not being rejected or discarded, validate the recipient here.
+     */
+    if (status != SMTPD_CHECK_REJECT && state->rcptmap_checked == 0
+       && state->discard == 0)
+       status = check_rcpt_maps(state, recipient);
+
     SMTPD_CHECK_RCPT_RETURN(status == SMTPD_CHECK_REJECT ? STR(error_text) : 0);
 }
 
@@ -3102,25 +3143,6 @@ char   *smtpd_check_etrn(SMTPD_STATE *state, char *domain)
     SMTPD_CHECK_ETRN_RETURN(status == SMTPD_CHECK_REJECT ? STR(error_text) : 0);
 }
 
-/* smtpd_check_rcptmap - permit if recipient address matches lookup table */
-
-char   *smtpd_check_rcptmap(SMTPD_STATE *state, char *recipient)
-{
-    char   *myname = "smtpd_check_rcptmap";
-    int     status;
-
-    if (msg_verbose)
-       msg_info("%s: %s", myname, recipient);
-
-    /*
-     * Return here in case of serious trouble.
-     */
-    if ((status = setjmp(smtpd_check_buf)) == 0)
-       status = check_rcpt_maps(state, recipient);
-
-    return (status == SMTPD_CHECK_REJECT ? STR(error_text) : 0);
-}
-
 /* check_rcpt_maps - generic_checks() interface for recipient table check */
 
 static int check_rcpt_maps(SMTPD_STATE *state, const char *recipient)
@@ -3198,13 +3220,13 @@ static int check_rcpt_maps(SMTPD_STATE *state, const char *recipient)
 
     if ((reply->flags & RESOLVE_CLASS_LOCAL)
        && *var_local_rcpt_maps
-       /* Generated by bounce, absorbed by qmgr. */
+    /* Generated by bounce, absorbed by qmgr. */
        && !MATCH_LEFT(var_double_bounce_sender, CONST_STR(reply->recipient),
                       strlen(var_double_bounce_sender))
-       /* Absorbed by qmgr. */
+    /* Absorbed by qmgr. */
        && !MATCH_LEFT(MAIL_ADDR_POSTMASTER, CONST_STR(reply->recipient),
                       strlen(MAIL_ADDR_POSTMASTER))
-       /* Generated by bounce. */
+    /* Generated by bounce. */
        && !MATCH_LEFT(MAIL_ADDR_MAIL_DAEMON, CONST_STR(reply->recipient),
                       strlen(MAIL_ADDR_MAIL_DAEMON))
        && NOMATCH(local_rcpt_maps, CONST_STR(reply->recipient)))
@@ -3486,6 +3508,7 @@ int     var_local_rcpt_code;
 int     var_relay_rcpt_code;
 int     var_virt_mailbox_code;
 int     var_virt_alias_code;
+int     var_show_unk_rcpt_table;
 
 static INT_TABLE int_table[] = {
     "msg_verbose", 0, &msg_verbose,
@@ -3505,6 +3528,7 @@ static INT_TABLE int_table[] = {
     VAR_RELAY_RCPT_CODE, DEF_RELAY_RCPT_CODE, &var_relay_rcpt_code,
     VAR_VIRT_ALIAS_CODE, DEF_VIRT_ALIAS_CODE, &var_virt_alias_code,
     VAR_VIRT_MAILBOX_CODE, DEF_VIRT_MAILBOX_CODE, &var_virt_mailbox_code,
+    VAR_SHOW_UNK_RCPT_TABLE, DEF_SHOW_UNK_RCPT_TABLE, &var_show_unk_rcpt_table,
     0,
 };
 
@@ -3883,8 +3907,7 @@ int     main(int argc, char **argv)
            } else if (strcasecmp(args->argv[0], "rcpt") == 0) {
                state.where = "RCPT";
                TRIM_ADDR(args->argv[1], addr);
-               (resp = smtpd_check_rcpt(&state, addr))
-                   || (resp = smtpd_check_rcptmap(&state, addr));
+               resp = smtpd_check_rcpt(&state, addr);
            }
            break;
 
index 60348c40d9a3db247a0a325f3d0b549112c05101..302e2690354b3fad5d65b6f1ef672a8b692590f9 100644 (file)
@@ -16,7 +16,6 @@ extern void smtpd_check_init(void);
 extern char *smtpd_check_client(SMTPD_STATE *);
 extern char *smtpd_check_helo(SMTPD_STATE *, char *);
 extern char *smtpd_check_mail(SMTPD_STATE *, char *);
-extern char *smtpd_check_rcptmap(SMTPD_STATE *, char *);
 extern char *smtpd_check_size(SMTPD_STATE *, off_t);
 extern char *smtpd_check_rcpt(SMTPD_STATE *, char *);
 extern char *smtpd_check_etrn(SMTPD_STATE *, char *);
index 024bb77ffea9ad9d898a138a8e462ee13d54823a..abffa1ff0ea673aa06c59cf36d7e3f5f349e4611 100644 (file)
@@ -11,6 +11,7 @@ sender_restrictions hash:./smtpd_check_access
 mail rejecttext@bad.domain
 mail filter@filter.domain
 mail filtertext@filter.domain
+mail filtertexttext@filter.domain
 mail hold@hold.domain
 mail holdtext@hold.domain
 mail discard@hold.domain
index e4760017777aac0bb5b5324e3f389fd7d54b8d7f..a73b5a1fc70e4e657e7b9c9d01192babb19cb1dd 100644 (file)
@@ -14,10 +14,13 @@ OK
 ./smtpd_check: <queue id>: reject: MAIL from localhost[127.0.0.1]: 554 <rejecttext@bad.domain>: Sender address rejected: text; from=<rejecttext@bad.domain> proto=SMTP
 554 <rejecttext@bad.domain>: Sender address rejected: text
 >>> mail filter@filter.domain
-./smtpd_check: warning: access map hash:./smtpd_check_access entry filter@filter.domain has FILTER entry without value
+./smtpd_check: warning: access map hash:./smtpd_check_access entry "filter@filter.domain" has FILTER entry without value
 OK
 >>> mail filtertext@filter.domain
-./smtpd_check: <queue id>: filter: MAIL from localhost[127.0.0.1]: <filtertext@filter.domain>: Sender address triggers FILTER text; from=<filtertext@filter.domain> proto=SMTP
+./smtpd_check: warning: access map hash:./smtpd_check_access entry "filtertext@filter.domain" requires transport:destination
+OK
+>>> mail filtertexttext@filter.domain
+./smtpd_check: <queue id>: filter: MAIL from localhost[127.0.0.1]: <filtertexttext@filter.domain>: Sender address triggers FILTER text:text; from=<filtertexttext@filter.domain> proto=SMTP
 OK
 >>> mail hold@hold.domain
 ./smtpd_check: <queue id>: hold: MAIL from localhost[127.0.0.1]: <hold@hold.domain>: Sender address triggers HOLD action; from=<hold@hold.domain> proto=SMTP
index 41405ef4f6bc203b30830b40f6c807f7a7d07595..bfcb3d35f4b17ebb3ada02b3937d772c20c4e7ed 100644 (file)
@@ -50,6 +50,7 @@ dsn.rfc-ignorant.org  $rbl_code client=$client
 rejecttext@bad.domain  reject text
 filter@filter.domain   filter
 filtertext@filter.domain       filter text
+filtertexttext@filter.domain   filter text:text
 hold@hold.domain       hold
 holdtext@hold.domain   hold text
 discard@hold.domain    discard
index 53ef2758085bbe62707ee5ae1baf7ed1dc378661..6475ae49b05f220bcbd470511cd37ed5f1f8de76 100644 (file)
@@ -97,6 +97,7 @@ void    smtpd_state_init(SMTPD_STATE *state, VSTREAM *stream)
     state->defer_if_permit_sender = 0;
     state->defer_if_reject.reason = 0;
     state->defer_if_permit.reason = 0;
+    state->discard = 0;
     state->expand_buf = 0;
 
 #ifdef USE_SASL_AUTH