]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
snapshot-20001209
authorWietse Venema <wietse@porcupine.org>
Sat, 9 Dec 2000 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:26:59 +0000 (06:26 +0000)
22 files changed:
postfix/HISTORY
postfix/INSTALL.sh
postfix/conf/main.cf
postfix/conf/sample-local.cf
postfix/src/bounce/bounce.c
postfix/src/global/deliver_flock.c
postfix/src/global/deliver_pass.c
postfix/src/global/mail_conf.h
postfix/src/global/mail_params.c
postfix/src/global/mail_params.h
postfix/src/global/mail_stream.c
postfix/src/global/mail_version.h
postfix/src/global/mbox_conf.c
postfix/src/lmtp/lmtp.c
postfix/src/local/local.c
postfix/src/master/multi_server.c
postfix/src/master/single_server.c
postfix/src/master/trigger_server.c
postfix/src/nqmgr/qmgr.c
postfix/src/postdrop/postdrop.c
postfix/src/trivial-rewrite/trivial-rewrite.c
postfix/src/util/safe_open.c

index dd441493d4f8c159894ff45761d2ce4eb862db4b..aa742df65c4278be1fdb4dfdafe2a97c9543b9b8 100644 (file)
@@ -4576,3 +4576,19 @@ Apologies for any names omitted.
        (asynchronous bounce client), qmgr/qmgr_active.c.  Problem
        reported by El Bunzo (webpower.nl) and Tiger Technologies
        (tigertech.com).
+
+20001209
+
+       Feature: mailbox_transport and fallback_transport can now
+       have the form transport:nexthop, with suitable defaults
+       when either transport or nexthop are omitted, just like in
+       the Postfix transport map. This allows you to specify for
+       example, "mailbox_transport = lmtp:unix:/file/name". File:
+       global/deliver_pass.c.
+
+       Bugfix: local_destination_concurrency_limit no longer works
+       as per-user concurrency limit but as per-domain limit, so
+       the limit of "2" in the sample main.cf files would result
+       in poor local delivery performance. The Postfix install
+       procedure repairs this.  Problem reported by David Schweikert
+       (ee.ethz.ch) and Dallas Wisehaupt (cynicism.com).
index df4f74351f1ccdec61bcd5a3dafb0c40ac3dd63a..c2e8e79a8145eb7b0eec837daed4d6811e4ccd61 100644 (file)
@@ -285,6 +285,7 @@ bin/postconf -c $CONFIG_DIRECTORY -e \
     "command_directory = $command_directory" \
     "queue_directory = $queue_directory" \
     "mail_owner = $mail_owner" \
+    "local_destination_concurrency_limit = 0" \
 || exit 1
 
 (echo "# This file was generated by $0"
index 15e12b10c9e6b473b31aca57ec232138fc33ef6d..52334767fec3e26827b6ec4f2b39f32573625237 100644 (file)
@@ -388,8 +388,11 @@ mail_owner = postfix
 # 
 # Each message delivery transport has its XXX_destination_concurrency_limit
 # parameter.  The default is $default_destination_concurrency_limit.
+# The limit is per destination domain, so the destination concurrency
+# limit for local delivery must be set to zero otherwise performance
+# will suffer.
 
-local_destination_concurrency_limit = 2
+local_destination_concurrency_limit = 0
 default_destination_concurrency_limit = 10
 
 # DEBUGGING CONTROL
index edf2c0fb75cec89586bd6ed775e89fa28a817ab9..ab2214468dabadca2e3b5accdbccce3943593a60 100644 (file)
@@ -150,12 +150,26 @@ mailbox_command =
 # has precedence over the mailbox_command, fallback_transport and
 # luser_relay parameters.
 #
+# Specify a string of the form transport:nexthop, where transport is
+# the name of a mail delivery transport defined in master.cf.  Either
+# transport or nexthop are optional. For more details see the sample
+# transports file.
+#
+# mailbox_transport = lmtp:unix:/file/name
+# mailbox_transport = cyrus
 mailbox_transport =
 
 # The fallback_transport specifies the optional transport in master.cf
 # to use for recipients that are not found in the UNIX passwd database.
 # This parameter has precedence over the luser_relay parameter.
 #
+# Specify a string of the form transport:nexthop, where transport is
+# the name of a mail delivery transport defined in master.cf.  Either
+# transport or nexthop are optional. For more details see the sample
+# transports file.
+#
+# fallback_transport = lmtp:unix:/file/name
+# fallback_transport = cyrus
 fallback_transport =
 
 #
@@ -163,14 +177,15 @@ fallback_transport =
 #
 
 # The local_destination_concurrency_limit parameter limits the number
-# of parallel deliveries to the same local recipient.
+# of parallel deliveries to the local domain. It should therefore be
+# set to zero, in order to prevent poor local delivery performance.
+# In old Postfix versions this parameter implemented a per-user
+# limit. That is no longer the case.
 #
 # The default limit is taken from the default_destination_concurrency_limit
-# parameter. I recommend a low limit of 2, just in case someone has
-# an expensive shell command in a .forward file or in an alias (e.g.,
-# a mailing list manager). You don't want to run lots of those.
+# parameter. 
 #
-local_destination_concurrency_limit = 2
+local_destination_concurrency_limit = 0
 
 # The local_destination_recipient_limit parameter limits the number
 # of recipients per local message delivery.  The default limit is
index 8ee090d5526e001ac629b75647845624c1d21331..33ec01a0b22a80528bbab6b1d523d91cf26f9eb5 100644 (file)
@@ -280,7 +280,7 @@ int     main(int argc, char **argv)
 {
     static CONFIG_INT_TABLE int_table[] = {
        VAR_BOUNCE_LIMIT, DEF_BOUNCE_LIMIT, &var_bounce_limit, 1, 0,
-       VAR_MAX_QUEUE_TIME, DEF_MAX_QUEUE_TIME, &var_max_queue_time, 1, 0,
+       VAR_MAX_QUEUE_TIME, DEF_MAX_QUEUE_TIME, &var_max_queue_time, 1, 1000,
        VAR_DELAY_WARN_TIME, DEF_DELAY_WARN_TIME, &var_delay_warn_time, 0, 0,
        0,
     };
index 2fa2b82728732ef93695d4ee8b489de530212af4..aa3f8b0f89a800e53ee657f6ef0e5639304ac594 100644 (file)
@@ -13,7 +13,7 @@
 /* DESCRIPTION
 /*     deliver_flock() sets one exclusive kernel lock on an open file,
 /*     for example in order to deliver mail.
-/*      It performs several non-blocking attempts to acquire an exclusive
+/*     It performs several non-blocking attempts to acquire an exclusive
 /*     lock before giving up.
 /*
 /*     Arguments:
@@ -57,9 +57,9 @@
 #include "mail_params.h"
 #include "deliver_flock.h"
 
-/* deliver_flock - lock open file for mail delivery*/
+/* deliver_flock - lock open file for mail delivery */
 
-int     deliver_flock(int fd, int lock_style, VSTRING * why)
+int     deliver_flock(int fd, int lock_style, VSTRING *why)
 {
     int     i;
 
index 4ae6ede78388fbd04259768254641cf00027572c..f9ceda49ffcdec276989242db3ef01bb9151120d 100644 (file)
@@ -30,7 +30,8 @@
 /* .IP class
 /*     Destination delivery agent service class
 /* .IP service
-/*     Destination delivery agent service name.
+/*     String of the form \fItransport\fR:\fInexthop\fR. Either transport
+/*     or nexthop are optional. For details see the transport map manual page.
 /* .IP request
 /*     Delivery request with queue file information.
 /* .IP address
 #include <msg.h>
 #include <vstring.h>
 #include <vstream.h>
+#include <split_at.h>
+#include <mymalloc.h>
 
 /* Global library. */
 
+#include <mail_params.h>
 #include <deliver_pass.h>
 
 /* deliver_pass_initial_reply - retrieve initial delivery process response */
@@ -83,7 +87,7 @@ static int deliver_pass_initial_reply(VSTREAM *stream)
 /* deliver_pass_send_request - send delivery request to delivery process */
 
 static int deliver_pass_send_request(VSTREAM *stream, DELIVER_REQUEST *request,
-                                            const char *addr, long offs)
+                          const char *nexthop, const char *addr, long offs)
 {
     int     stat;
 
@@ -91,7 +95,7 @@ static int deliver_pass_send_request(VSTREAM *stream, DELIVER_REQUEST *request,
               request->flags,
               request->queue_name, request->queue_id,
               request->data_offset, request->data_size,
-              request->nexthop, request->sender,
+              nexthop, request->sender,
               request->errors_to, request->return_receipt,
               request->arrival_time,
               offs, addr, "0");
@@ -126,11 +130,24 @@ int     deliver_pass(const char *class, const char *service,
     VSTREAM *stream;
     VSTRING *reason;
     int     status;
+    char   *saved_service;
+    char   *transport;
+    char   *nexthop;
+
+    /*
+     * Parse service into transport:nexthop form, and allow for omission of
+     * optional fields
+     */
+    transport = saved_service = mystrdup(service);
+    if ((nexthop = split_at(saved_service, ':')) == 0 || *nexthop == 0)
+       nexthop = request->nexthop;
+    if (*transport == 0)
+       transport = var_def_transport;
 
     /*
      * Initialize.
      */
-    stream = mail_connect_wait(class, service);
+    stream = mail_connect_wait(class, transport);
     reason = vstring_alloc(1);
 
     /*
@@ -144,7 +161,8 @@ int     deliver_pass(const char *class, const char *service,
      * different transport.
      */
     if ((status = deliver_pass_initial_reply(stream)) == 0
-       && (status = deliver_pass_send_request(stream, request, addr, offs)) == 0)
+       && (status = deliver_pass_send_request(stream, request, nexthop,
+                                              addr, offs)) == 0)
        status = deliver_pass_final_reply(stream, reason);
 
     /*
@@ -152,6 +170,7 @@ int     deliver_pass(const char *class, const char *service,
      */
     vstream_fclose(stream);
     vstring_free(reason);
+    myfree(saved_service);
 
     return (status);
 }
index 5ebf43d700659f48ee594fdb3b208f69d081fc0a..60bd859e220600bf0a58b675d65904e8164f0512 100644 (file)
@@ -46,7 +46,6 @@ extern const char *mail_conf_lookup_eval(const char *);
 extern char *get_mail_conf_str(const char *, const char *, int, int);
 extern int get_mail_conf_int(const char *, int, int, int);
 extern int get_mail_conf_bool(const char *, int);
-extern int get_mail_conf_lock(const char *, int);
 extern int get_mail_conf_time(const char *, const char *, int, int, int);
 extern char *get_mail_conf_raw(const char *, const char *, int, int);
 
@@ -59,7 +58,6 @@ extern int get_mail_conf_time2(const char *, const char *, const char *, int, in
 extern char *get_mail_conf_str_fn(const char *, const char *(*) (void), int, int);
 extern int get_mail_conf_int_fn(const char *, int (*) (void), int, int);
 extern int get_mail_conf_bool_fn(const char *, int (*) (void));
-extern int get_mail_conf_lock_fn(const char *, int (*) (void));
 extern int get_mail_conf_time_fn(const char *, const char *(*) (void), int, int, int);
 extern char *get_mail_conf_raw_fn(const char *, const char *(*) (void), int, int);
 
@@ -69,7 +67,6 @@ extern char *get_mail_conf_raw_fn(const char *, const char *(*) (void), int, int
 extern void set_mail_conf_str(const char *, const char *);
 extern void set_mail_conf_int(const char *, int);
 extern void set_mail_conf_bool(const char *, int);
-extern void set_mail_conf_lock(const char *, int);
 extern void set_mail_conf_time(const char *, const char *);
 
  /*
@@ -98,12 +95,6 @@ typedef struct {
     int    *target;                    /* pointer to global variable */
 } CONFIG_BOOL_TABLE;
 
-typedef struct {
-    const char *name;                  /* config variable name */
-    int     defval;                    /* default value */
-    int    *target;                    /* pointer to global variable */
-} CONFIG_LOCK_TABLE;
-
 typedef struct {
     const char *name;                  /* config variable name */
     const char *defval;                        /* default value */
@@ -116,7 +107,6 @@ typedef struct {
 extern void get_mail_conf_str_table(CONFIG_STR_TABLE *);
 extern void get_mail_conf_int_table(CONFIG_INT_TABLE *);
 extern void get_mail_conf_bool_table(CONFIG_BOOL_TABLE *);
-extern void get_mail_conf_lock_table(CONFIG_LOCK_TABLE *);
 extern void get_mail_conf_time_table(CONFIG_TIME_TABLE *);
 extern void get_mail_conf_raw_table(CONFIG_STR_TABLE *);
 
@@ -146,12 +136,6 @@ typedef struct {
     int    *target;                    /* pointer to global variable */
 } CONFIG_BOOL_FN_TABLE;
 
-typedef struct {
-    const char *name;                  /* config variable name */
-    int     (*defval) (void);          /* default value provider */
-    int    *target;                    /* pointer to global variable */
-} CONFIG_LOCK_FN_TABLE;
-
 typedef struct {
     const char *name;                  /* config variable name */
     const char *(*defval) (void);      /* default value provider */
@@ -164,7 +148,6 @@ typedef struct {
 extern void get_mail_conf_str_fn_table(CONFIG_STR_FN_TABLE *);
 extern void get_mail_conf_int_fn_table(CONFIG_INT_FN_TABLE *);
 extern void get_mail_conf_bool_fn_table(CONFIG_BOOL_FN_TABLE *);
-extern void get_mail_conf_lock_fn_table(CONFIG_LOCK_FN_TABLE *);
 extern void get_mail_conf_time_fn_table(CONFIG_TIME_FN_TABLE *);
 extern void get_mail_conf_raw_fn_table(CONFIG_STR_FN_TABLE *);
 
index 14a588c8f732eef4632ac3089c542785570c5b14..6f4c05f3d6f020628b8038ef098c85e9a96c2904 100644 (file)
@@ -59,6 +59,7 @@
 /*     char    *var_syslog_facility;
 /*     char    *var_relay_domains;
 /*     char    *var_fflush_domains;
+/*     char    *var_def_transport;
 /*
 /*     char    *var_import_environ;
 /*     char    *var_export_environ;
 #include "mynetworks.h"
 #include "mail_conf.h"
 #include "mail_version.h"
+#include "mail_proto.h"
 #include "mail_params.h"
 
  /*
@@ -169,6 +171,7 @@ int     var_daemon_timeout;
 char   *var_syslog_facility;
 char   *var_relay_domains;
 char   *var_fflush_domains;
+char   *var_def_transport;
 
 char   *var_import_environ;
 char   *var_export_environ;
@@ -286,6 +289,7 @@ void    mail_params_init()
        VAR_FFLUSH_DOMAINS, DEF_FFLUSH_DOMAINS, &var_fflush_domains, 0, 0,
        VAR_EXPORT_ENVIRON, DEF_EXPORT_ENVIRON, &var_export_environ, 0, 0,
        VAR_IMPORT_ENVIRON, DEF_IMPORT_ENVIRON, &var_import_environ, 0, 0,
+       VAR_DEF_TRANSPORT, DEF_DEF_TRANSPORT, &var_def_transport, 0, 0,
        0,
     };
     static CONFIG_STR_FN_TABLE function_str_defaults_2[] = {
index 2235cabd6ab9d269666ffb036f54f724e2a06d03..dbe04aa0663687e665e8c6b3f1a69b0280ca2ac5 100644 (file)
@@ -1107,8 +1107,6 @@ extern char *var_export_environ;
 /* LICENSE
 /* .ad
 /* .fi
-Unterminated comment
-
 /*     The Secure Mailer license must be distributed with this software.
 /* AUTHOR(S)
 /*     Wietse Venema
index 9cb5118aca9068d33a735771c981503e38ca6b5b..e30537dfff69f02dbf0abd872603971936cf45e6 100644 (file)
@@ -247,6 +247,12 @@ MAIL_STREAM *mail_stream_command(const char *command)
     /*
      * Treat fork() failure as a transient problem. Treat bad handshake as a
      * permanent error.
+     * 
+     * XXX Are we invoking a Postfix process or a non-Postfix process? In the
+     * former case we can share the full environment; in the latter case only
+     * a restricted environment should be propagated. Even though we are
+     * talking a Postfix-internal protocol there is no way we can tell what
+     * is being executed except by duplicating a lot of existing code.
      */
     export_env = argv_split(var_export_environ, ", \t\r\n");
     while ((stream = vstream_popen(O_RDWR,
index 46ba5a8bebe3fb069f269147b261daca484e4c11..7588e001ea93317a32e4e7a3e0b4a43aeda559f9 100644 (file)
@@ -15,7 +15,7 @@
   * Version of this program.
   */
 #define VAR_MAIL_VERSION       "mail_version"
-#define DEF_MAIL_VERSION       "Snapshot-20001208"
+#define DEF_MAIL_VERSION       "Snapshot-20001209"
 extern char *var_mail_version;
 
 /* LICENSE
index ba3b0cd943e6dc8936d973f7d78f039215add07c..2eb8e8bb96be273cac7f184014883c0f3fb978ae 100644 (file)
@@ -12,7 +12,7 @@
 /*     ARGV    *mbox_lock_names()
 /* DESCRIPTION
 /*     The functions in this module translate between external
-/*     mailbox locking method names and internal forms.
+/*     mailbox locking method names and internal representations.
 /*
 /*     mbox_lock_mask() translates a string with locking method names
 /*     into a bit mask. Names are separated by comma or whitespace.
 /* .IP "flock (MBOX_FLOCK_LOCK)"
 /*     Use flock() style lock after opening the file. This is the mailbox 
 /*     locking method traditionally used on BSD-ish systems (including 
-/*     Ultrix and SunOS).
+/*     Ultrix and SunOS). It is not suitable for remote file systems.
 /* .IP "fcntl (MBOX_FCNTL_LOCK)"
 /*     Use fcntl() style lock after opening the file. This is the mailbox 
 /*     locking method on System-V-ish systems (Solaris, AIX, IRIX, HP-UX).
+/*     This method is supposed to work for remote systems, but often
+/*     has problems.
 /* .IP "dotlock (MBOX_DOT_LOCK)"
 /*     Create a lock file with the name \fIfilename\fB.lock\fR. This
-/*     method pre-dates kernel locks.
+/*     method pre-dates kernel locks. This works with remote file systems,
+/*     modulo cache coherency problems.
 /* .PP
 /*     mbox_lock_names() returns an array with the names of available
 /*     mailbox locking methods. The result should be given to argv_free().
@@ -60,9 +63,9 @@
 
  /*
   * The table with available mailbox locking methods. Some systems have
-  * flock() locks; all POSIX-compatible systems should have fcntl() locks.
-  * Even though some systems do not use dotlock files, it can be necessary
-  * when accessing mailbox files over NFS.
+  * flock() locks; all POSIX-compatible systems have fcntl() locks. Even
+  * though some systems do not use dotlock files by default (4.4BSD), such
+  * locks can be necessary when accessing mailbox files over NFS.
   */
 static NAME_MASK mbox_mask[] = {
 #ifdef HAS_FLOCK_LOCK
index ae11338c5ecd955b04fef4fe49cb5c3f1e703858..5733c600ee11c37ad2bf08bd462091b34b8bf014 100644 (file)
@@ -391,7 +391,7 @@ static int deliver_message(DELIVER_REQUEST *request, char **unused_argv)
 
 /* lmtp_service - perform service for client */
 
-static void lmtp_service(VSTREAM * client_stream, char *unused_service, char **argv)
+static void lmtp_service(VSTREAM *client_stream, char *unused_service, char **argv)
 {
     DELIVER_REQUEST *request;
     int     status;
index 981012b2298f88cf5b28f8ce9166284232300978..8e9f477280385ff8844b7ea9dfa522cb0dce5cd7 100644 (file)
@@ -595,7 +595,8 @@ static void local_mask_init(void)
        local_mbox_lock_mask &= MBOX_DOT_LOCK;
     }
     if (local_mbox_lock_mask == 0)
-       msg_fatal("no applicable mailbox locking method");
+       msg_fatal("parameter %s specifies no applicable mailbox locking method",
+                 VAR_MAILBOX_LOCK);
 }
 
 /* pre_accept - see if tables have changed */
index 856d1e318036ea16cf5635998436d50b85c54fae..7ee9520cd30e99e039f2165e19185fa0f9131c55 100644 (file)
@@ -220,7 +220,7 @@ static void multi_server_timeout(int unused_event, char *unused_context)
 
 /* multi_server_disconnect - terminate client session */
 
-void    multi_server_disconnect(VSTREAM * stream)
+void    multi_server_disconnect(VSTREAM *stream)
 {
     if (msg_verbose)
        msg_info("connection closed fd %d", vstream_fileno(stream));
@@ -548,7 +548,7 @@ NORETURN multi_server_main(int argc, char **argv, MULTI_SERVER_FN service,...)
                                ".", service_name, (char *) 0);
        why = vstring_alloc(1);
        if ((multi_server_lock = safe_open(lock_path, O_CREAT | O_RDWR, 0600,
-                                          (struct stat *) 0, -1, -1, why)) == 0)
+                                     (struct stat *) 0, -1, -1, why)) == 0)
            msg_fatal("open lock file %s: %s", lock_path, vstring_str(why));
        close_on_exec(vstream_fileno(multi_server_lock), CLOSE_ON_EXEC);
        myfree(lock_path);
index 583abd3b5a0470cce299dd73e5c277cf6da3b6da..78d868c2c24e450aed1d2a4f870abeadffbfad80 100644 (file)
@@ -519,7 +519,7 @@ NORETURN single_server_main(int argc, char **argv, SINGLE_SERVER_FN service,...)
                                ".", service_name, (char *) 0);
        why = vstring_alloc(1);
        if ((single_server_lock = safe_open(lock_path, O_CREAT | O_RDWR, 0600,
-                                           (struct stat *) 0, -1, -1, why)) == 0)
+                                     (struct stat *) 0, -1, -1, why)) == 0)
            msg_fatal("open lock file %s: %s", lock_path, vstring_str(why));
        close_on_exec(vstream_fileno(single_server_lock), CLOSE_ON_EXEC);
        myfree(lock_path);
index c6df3a99a4b0c9763a8f5f725e316b5e641470a2..92fdd27af1bd643b750912ed95eb2cccf1c932aa 100644 (file)
@@ -533,7 +533,7 @@ NORETURN trigger_server_main(int argc, char **argv, TRIGGER_SERVER_FN service,..
                                ".", service_name, (char *) 0);
        why = vstring_alloc(1);
        if ((trigger_server_lock = safe_open(lock_path, O_CREAT | O_RDWR, 0600,
-                                            (struct stat *) 0, -1, -1, why)) == 0)
+                                     (struct stat *) 0, -1, -1, why)) == 0)
            msg_fatal("open lock file %s: %s", lock_path, vstring_str(why));
        close_on_exec(vstream_fileno(trigger_server_lock), CLOSE_ON_EXEC);
        myfree(lock_path);
index 39705adbf08db1606777ab1dc3758edeac6e67c2..33374d7c3018773b8bc970fb135130669a31ca83 100644 (file)
@@ -515,7 +515,7 @@ int     main(int argc, char **argv)
        VAR_MAX_BACKOFF_TIME, DEF_MAX_BACKOFF_TIME, &var_max_backoff_time, 1, 0,
        VAR_MAX_QUEUE_TIME, DEF_MAX_QUEUE_TIME, &var_max_queue_time, 1, 1000,
        VAR_QMGR_ACT_LIMIT, DEF_QMGR_ACT_LIMIT, &var_qmgr_active_limit, 1, 0,
-       VAR_QMGR_RCPT_LIMIT, DEF_QMGR_RCPT_LIMIT, &var_qmgr_rcpt_limit, 0, 0,
+       VAR_QMGR_RCPT_LIMIT, DEF_QMGR_RCPT_LIMIT, &var_qmgr_rcpt_limit, 1, 0,
        VAR_QMGR_MSG_RCPT_LIMIT, DEF_QMGR_MSG_RCPT_LIMIT, &var_qmgr_msg_rcpt_limit, 1, 0,
        VAR_XPORT_RCPT_LIMIT, DEF_XPORT_RCPT_LIMIT, &var_xport_rcpt_limit, 0, 0,
        VAR_STACK_RCPT_LIMIT, DEF_STACK_RCPT_LIMIT, &var_stack_rcpt_limit, 0, 0,
index f3b5faa0d1eb381b8fe9388b106b83ffd6e6888c..4a8c16d3c4823e6a3a703a4f4cd5b4646094cd49 100644 (file)
@@ -174,13 +174,6 @@ int     main(int argc, char **argv)
            && (close(fd), open("/dev/null", O_RDWR, 0)) != fd)
            msg_fatal("open /dev/null: %m");
 
-    /*
-     * Strip the environment so we don't have to trust the C library.
-     */
-    import_env = argv_split(var_import_environ, ", \t\r\n");
-    clean_env(import_env->argv);
-    argv_free(import_env);
-
     /*
      * Set up logging. Censor the process name: it is provided by the user.
      */
@@ -199,6 +192,14 @@ int     main(int argc, char **argv)
      * perform some sanity checks on the input.
      */
     mail_conf_read();
+
+    /*
+     * Strip the environment so we don't have to trust the C library.
+     */
+    import_env = argv_split(var_import_environ, ", \t\r\n");
+    clean_env(import_env->argv);
+    argv_free(import_env);
+
     if (chdir(var_queue_dir))
        msg_fatal("chdir %s: %m", var_queue_dir);
     if (msg_verbose)
index bcba49154b7f1fee232e38731a9d06341baf6fb3..c533a9aeb3d28e02c4d0072391e8b8cecd47656f 100644 (file)
@@ -147,7 +147,6 @@ static VSTRING *command;
   * Tunable parameters.
   */
 char   *var_transport_maps;
-char   *var_def_transport;
 bool    var_swap_bangpath;
 bool    var_append_dot_mydomain;
 bool    var_append_at_myorigin;
@@ -210,7 +209,6 @@ int     main(int argc, char **argv)
 {
     static CONFIG_STR_TABLE str_table[] = {
        VAR_TRANSPORT_MAPS, DEF_TRANSPORT_MAPS, &var_transport_maps, 0, 0,
-       VAR_DEF_TRANSPORT, DEF_DEF_TRANSPORT, &var_def_transport, 0, 0,
        VAR_LOCAL_TRANSPORT, DEF_LOCAL_TRANSPORT, &var_local_transport, 0, 0,
        0,
     };
index ac1aed3a8aa6f17fabc45c415e0c77a5f4bd06d7..4183a1b8cb9dbbcbfadb2de776d7bb39baff68eb 100644 (file)
@@ -109,8 +109,8 @@ static VSTREAM *safe_open_exist(const char *path, int flags,
     if (fstat_st == 0)
        fstat_st = &local_statbuf;
     if (fstat(vstream_fileno(fp), fstat_st) < 0) {
-       msg_fatal("bad open file status: %m");
-    } else if (fstat_st->st_nlink != 1) {
+       msg_fatal("%s: bad open file status: %m", path);
+    } else if (fstat_st->st_nlink > 1) {
        vstring_sprintf(why, "file has multiple hard links");
     } else if (S_ISDIR(fstat_st->st_mode)) {
        vstring_sprintf(why, "file is a directory");
@@ -187,7 +187,7 @@ static VSTREAM *safe_open_create(const char *path, int flags, int mode,
      * Optionally look up the file attributes.
      */
     if (st != 0 && fstat(vstream_fileno(fp), st) < 0)
-       msg_fatal("bad open file status: %m");
+       msg_fatal("%s: bad open file status: %m", path);
 
     /*
      * We are almost there...