]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.0.0-20030106
authorWietse Venema <wietse@porcupine.org>
Mon, 6 Jan 2003 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:28:41 +0000 (06:28 +0000)
14 files changed:
postfix/HISTORY
postfix/src/global/dict_proxy.c
postfix/src/global/mail_version.h
postfix/src/master/multi_server.c
postfix/src/master/single_server.c
postfix/src/master/trigger_server.c
postfix/src/nqmgr/qmgr_bounce.c
postfix/src/nqmgr/qmgr_defer.c
postfix/src/nqmgr/qmgr_message.c
postfix/src/proxymap/proxymap.c
postfix/src/qmgr/qmgr_bounce.c
postfix/src/qmgr/qmgr_defer.c
postfix/src/qmgr/qmgr_message.c
postfix/src/smtpd/smtpd.c

index 581117f68fbda61caf3dc9afd0a3a74c12073fab..63c7c98ad7bf5b2e3f0db385759fe932ce262935 100644 (file)
@@ -7665,6 +7665,31 @@ Apologies for any names omitted.
        than a year until I found out how to reproduce it. File:
        util/vstream.c.
 
+20030105
+
+       Cleanup: removed the address syntax check from the queue
+       manager, since a better test was implemented recently in
+       the trivial-rewrite server. Files: *qmgr/qmgr_message.c.
+
+       Bugfix: redirect bounce/defer to the address verification
+       service where appropriate. Files: *qmgr/qmgr_bounce.c,
+       *qmgr/qmgr_defer.c.
+
+       Bugfix: "no such file or directory" warnings after "postfix
+       reload" when a chrooted smtpd reconnects to the proxy
+       service.  Fix: use "private/proxymap" if possible, otherwise
+       use "$queue_dir/private/proxymap".  File:  global/dict_proxy.c.
+
+       Robustness: daemons now chdir() to the queue directory before
+       running the pre-jail initialization code, so that daemons
+       running in stand-alone mode produce more consistent results.
+       Files:  master/single_server.c, master/multi_server.c.
+       master/trigger_server.c.
+
+       Bugfix: "sendmail -bs" tried to access the proxymap service.
+       It should not try to open any user/domain/uce related tables
+       at all. File:  smtpd/smtpd.c.
+
 Open problems:
 
        Med: do not postpone rejected "MAIL FROM" size information,
index 28a6b3566054bac6c18dd7744a8996ad6c154c10..70bc5b87f7f0f2f5a348ee08bd88ff050615654a 100644 (file)
@@ -194,11 +194,11 @@ DICT   *dict_proxy_open(const char *map, int open_flags, int dict_flags)
      * XXX Use absolute pathname to make this work from non-daemon processes.
      */
     if (proxy_stream == 0) {
-       if (access(var_queue_dir, F_OK) == 0)
+       if (access(MAIL_CLASS_PRIVATE "/" MAIL_SERVICE_PROXYMAP, F_OK) == 0)
+           prefix = MAIL_CLASS_PRIVATE;
+       else
            prefix = kludge = concatenate(var_queue_dir, "/",
                                          MAIL_CLASS_PRIVATE, (char *) 0);
-       else
-           prefix = MAIL_CLASS_PRIVATE;
        proxy_stream = clnt_stream_create(prefix,
                                          MAIL_SERVICE_PROXYMAP,
                                          var_ipc_idle_limit,
index 61919dd0c19cb18993e73e88d99f6b25574bcd82..04deb4c761c5345459cb1a506a5c4b44c8f38d69 100644 (file)
@@ -20,7 +20,7 @@
   * 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      "20030105"
+#define MAIL_RELEASE_DATE      "20030106"
 
 #define VAR_MAIL_VERSION       "mail_version"
 #define DEF_MAIL_VERSION       "2.0.0-" MAIL_RELEASE_DATE
index 9fdbd657b45acd507d47d4e4dc76901a083c8a7e..f4d12996d092e499781ffe6caca87a3be75664a3 100644 (file)
@@ -629,14 +629,14 @@ NORETURN multi_server_main(int argc, char **argv, MULTI_SERVER_FN service,...)
     /*
      * Run pre-jail initialization.
      */
+    if (chdir(var_queue_dir) < 0)
+       msg_fatal("chdir(\"%s\"): %m", var_queue_dir);
     if (pre_init)
        pre_init(multi_server_name, multi_server_argv);
 
     /*
      * Optionally, restrict the damage that this process can do.
      */
-    if (chdir(var_queue_dir) < 0)
-       msg_fatal("chdir(\"%s\"): %m", var_queue_dir);
     resolve_local_init();
     chroot_uid(root_dir, user_name);
 
index 9e269e98d88fdac5cccaf345961de36d71dffaf3..c2feb94a65ac1fbbe78c33d767610d2214d9ae01 100644 (file)
@@ -574,14 +574,14 @@ NORETURN single_server_main(int argc, char **argv, SINGLE_SERVER_FN service,...)
     /*
      * Run pre-jail initialization.
      */
+    if (chdir(var_queue_dir) < 0)
+       msg_fatal("chdir(\"%s\"): %m", var_queue_dir);
     if (pre_init)
        pre_init(single_server_name, single_server_argv);
 
     /*
      * Optionally, restrict the damage that this process can do.
      */
-    if (chdir(var_queue_dir) < 0)
-       msg_fatal("chdir(\"%s\"): %m", var_queue_dir);
     resolve_local_init();
     chroot_uid(root_dir, user_name);
 
index 685973a07e279d367a632f179e74308c16a06841..e7640ed2f2ffb88d29716316fc8be9b3350ad22a 100644 (file)
@@ -584,14 +584,14 @@ NORETURN trigger_server_main(int argc, char **argv, TRIGGER_SERVER_FN service,..
     /*
      * Run pre-jail initialization.
      */
+    if (chdir(var_queue_dir) < 0)
+       msg_fatal("chdir(\"%s\"): %m", var_queue_dir);
     if (pre_init)
        pre_init(trigger_server_name, trigger_server_argv);
 
     /*
      * Optionally, restrict the damage that this process can do.
      */
-    if (chdir(var_queue_dir) < 0)
-       msg_fatal("chdir(\"%s\"): %m", var_queue_dir);
     resolve_local_init();
     chroot_uid(root_dir, user_name);
 
index 0f9d50bee5f1087d72feb772392d62ed64201d47..8e12bf17612a6761feb978070c5b08a75164e239 100644 (file)
@@ -67,7 +67,7 @@ void    qmgr_bounce_recipient(QMGR_MESSAGE *message, QMGR_RCPT *recipient,
     int     status;
 
     va_start(ap, format);
-    status = vbounce_append(BOUNCE_FLAG_KEEP, message->queue_id,
+    status = vbounce_append(message->tflags, message->queue_id,
                            recipient->orig_rcpt, recipient->address, "none",
                            message->arrival_time, format, ap);
     va_end(ap);
index 21ffdd6fd5825fe13183c0a4c6c61b58b1d0f44a..c286ef3a2325001264cf698de7470f84835184c8 100644 (file)
@@ -158,7 +158,7 @@ void    qmgr_defer_recipient(QMGR_MESSAGE *message, QMGR_RCPT *recipient,
     /*
      * Update the message structure and log the message disposition.
      */
-    message->flags |= defer_append(BOUNCE_FLAG_KEEP, message->queue_id,
+    message->flags |= defer_append(message->tflags, message->queue_id,
                                   recipient->orig_rcpt, recipient->address,
                               "none", message->arrival_time, "%s", reason);
 }
index 7d77c849ca5d9a399923a279e2b59a53f3284d36..9ff0c6d60e56934680f5e21b70e05eb94382e06d 100644 (file)
@@ -643,22 +643,6 @@ static void qmgr_message_resolve(QMGR_MESSAGE *message)
     resolve_clnt_init(&reply);
     for (recipient = list.info; recipient < list.info + list.len; recipient++) {
 
-       /*
-        * This may be a bit late in the game, but it is the most convenient
-        * place to scrutinize the destination address syntax. We have a
-        * complete queue file, so bouncing is easy. That luxury is not
-        * available to the cleanup service. The main issue is that we want
-        * to have this test in one place, instead of having to do this in
-        * every front-ent program.
-        */
-       if ((at = strrchr(recipient->address, '@')) != 0
-           && (at + 1)[strspn(at + 1, "[]0123456789.")] != 0
-           && valid_hostname(at + 1, DONT_GRIPE) == 0) {
-           qmgr_bounce_recipient(message, recipient,
-                                 "bad host/domain syntax: \"%s\"", at + 1);
-           continue;
-       }
-
        /*
         * Resolve the destination to (transport, nexthop, address). The
         * result address may differ from the one specified by the sender.
index 39b4f713f4e0c3bd748bb0be6aca2d656c4375b0..345862e0b74389a82e3a475847732e389333cc93 100644 (file)
@@ -181,7 +181,8 @@ static VSTRING *map_type_name_flags;
 
 /* proxy_map_find - look up or open table */
 
-static DICT *proxy_map_find(const char *map_type_name, int request_flags)
+static DICT *proxy_map_find(const char *map_type_name, int request_flags,
+                                   int *statp)
 {
     DICT   *dict;
 
@@ -193,13 +194,17 @@ static DICT *proxy_map_find(const char *map_type_name, int request_flags)
      * Canonicalize the map name. If the map is not on the approved list,
      * deny the request.
      */
+#define PROXY_MAP_FIND_ERROR_RETURN(x)  { *statp = (x); return (0); }
+
     while (strncmp(map_type_name, PROXY_COLON, PROXY_COLON_LEN) == 0)
        map_type_name += PROXY_COLON_LEN;
+    if (strchr(map_type_name, ':') == 0)
+       PROXY_MAP_FIND_ERROR_RETURN(PROXY_STAT_BAD);
     if (htable_locate(proxy_read_maps, map_type_name) == 0) {
        msg_warn("request for unapproved table: \"%s\"", map_type_name);
        msg_warn("to approve a table for %s access, specify it in %s with %s",
                 MAIL_SERVICE_PROXYMAP, MAIN_CONF_FILE, VAR_PROXY_READ_MAPS);
-       return (0);
+       PROXY_MAP_FIND_ERROR_RETURN(PROXY_STAT_DENY);
     }
 
     /*
@@ -234,8 +239,8 @@ static void proxymap_lookup_service(VSTREAM *client_stream)
                  ATTR_TYPE_END) != 3) {
        reply_status = PROXY_STAT_BAD;
        reply_value = "";
-    } else if ((dict = proxy_map_find(STR(request_map), request_flags)) == 0) {
-       reply_status = PROXY_STAT_DENY;
+    } else if ((dict = proxy_map_find(STR(request_map), request_flags,
+                                     &reply_status)) == 0) {
        reply_value = "";
     } else if ((reply_value = dict_get(dict, STR(request_key))) != 0) {
        reply_status = PROXY_STAT_OK;
@@ -274,8 +279,8 @@ static void proxymap_open_service(VSTREAM *client_stream)
                  ATTR_TYPE_END) != 2) {
        reply_status = PROXY_STAT_BAD;
        reply_flags = 0;
-    } else if ((dict = proxy_map_find(STR(request_map), request_flags)) == 0) {
-       reply_status = PROXY_STAT_DENY;
+    } else if ((dict = proxy_map_find(STR(request_map), request_flags,
+                                     &reply_status)) == 0) {
        reply_flags = 0;
     } else {
        reply_status = PROXY_STAT_OK;
@@ -305,8 +310,8 @@ static void proxymap_service(VSTREAM *client_stream, char *unused_service,
 
     /*
      * This routine runs whenever a client connects to the socket dedicated
-     * to the address verification service. All connection-management stuff
-     * is handled by the common code in multi_server.c.
+     * to the proxymap service. All connection-management stuff is handled by
+     * the common code in multi_server.c.
      */
     if (attr_scan(client_stream,
                  ATTR_FLAG_MORE | ATTR_FLAG_STRICT,
index 23b92447b1f51189ae17c8d78d5f15e78604ed2d..15d59e07c61ead13d43a1d1e3aec8872d40b50b2 100644 (file)
@@ -62,7 +62,7 @@ void    qmgr_bounce_recipient(QMGR_MESSAGE *message, QMGR_RCPT *recipient,
     int     status;
 
     va_start(ap, format);
-    status = vbounce_append(BOUNCE_FLAG_KEEP, message->queue_id,
+    status = vbounce_append(message->tflags, message->queue_id,
                            recipient->orig_rcpt, recipient->address, "none",
                            message->arrival_time, format, ap);
     va_end(ap);
index c897605e6601810375789aa400dd41de09b68693..60fccd8dcb47d20dd0e70e9103c29df21c73dd43 100644 (file)
@@ -153,7 +153,7 @@ void    qmgr_defer_recipient(QMGR_MESSAGE *message, QMGR_RCPT *recipient,
     /*
      * Update the message structure and log the message disposition.
      */
-    message->flags |= defer_append(BOUNCE_FLAG_KEEP, message->queue_id,
+    message->flags |= defer_append(message->tflags, message->queue_id,
                                   recipient->orig_rcpt, recipient->address,
                               "none", message->arrival_time, "%s", reason);
 }
index 16a0c2245e69a3708a1f40c0deb425753aecec7d..b04ba3f1ec98f76752012ba43e57bf26a6911da3 100644 (file)
@@ -523,22 +523,6 @@ static void qmgr_message_resolve(QMGR_MESSAGE *message)
     resolve_clnt_init(&reply);
     for (recipient = list.info; recipient < list.info + list.len; recipient++) {
 
-       /*
-        * This may be a bit late in the game, but it is the most convenient
-        * place to scrutinize the destination address syntax. We have a
-        * complete queue file, so bouncing is easy. That luxury is not
-        * available to the cleanup service. The main issue is that we want
-        * to have this test in one place, instead of having to do this in
-        * every front-ent program.
-        */
-       if ((at = strrchr(recipient->address, '@')) != 0
-           && (at + 1)[strspn(at + 1, "[]0123456789.")] != 0
-           && valid_hostname(at + 1, DONT_GRIPE) == 0) {
-           qmgr_bounce_recipient(message, recipient,
-                                 "bad host/domain syntax: \"%s\"", at + 1);
-           continue;
-       }
-
        /*
         * Resolve the destination to (transport, nexthop, address). The
         * result address may differ from the one specified by the sender.
index 7db37ba26494dbc78d8092332820399e2fad964e..03a4d2c7adfb16d341733e4253ceb3f8afdc1ade 100644 (file)
@@ -1621,7 +1621,8 @@ static void pre_jail_init(char *unused_name, char **unused_argv)
      */
     smtpd_noop_cmds = string_list_init(MATCH_FLAG_NONE, var_smtpd_noop_cmds);
     verp_clients = namadr_list_init(MATCH_FLAG_NONE, var_verp_clients);
-    smtpd_check_init();
+    if (getuid() == 0 || getuid() == var_owner_uid)
+       smtpd_check_init();
     debug_peer_init();
 
     if (var_smtpd_sasl_enable)