]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
snapshot-20001215
authorWietse Venema <wietse@porcupine.org>
Fri, 15 Dec 2000 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:27:01 +0000 (06:27 +0000)
27 files changed:
postfix/HISTORY
postfix/RELEASE_NOTES
postfix/SASL_README
postfix/conf/sample-misc.cf
postfix/conf/sample-rate.cf
postfix/conf/sample-resource.cf
postfix/conf/sample-smtp.cf
postfix/conf/sample-smtpd.cf
postfix/src/bounce/bounce.c
postfix/src/cleanup/cleanup_init.c
postfix/src/flush/flush.c
postfix/src/global/mail_conf.h
postfix/src/global/mail_conf_time.c
postfix/src/global/mail_params.c
postfix/src/global/mail_version.h
postfix/src/lmtp/lmtp.c
postfix/src/local/local.c
postfix/src/master/master_vars.c
postfix/src/nqmgr/qmgr.c
postfix/src/pipe/pipe.c
postfix/src/postconf/postconf.c
postfix/src/qmgr/qmgr.c
postfix/src/smtp/smtp.c
postfix/src/smtpd/smtpd.c
postfix/src/spawn/spawn.c
postfix/src/trivial-rewrite/transport.c
postfix/src/util/dict_ldap.c

index 9993b0e0e8f69425880a97d7176b20a80e69fa78..9afd9d3b62731e04c09314f057e449dd9b63b0fe 100644 (file)
@@ -4630,12 +4630,30 @@ Apologies for any names omitted.
 
        Bugfix: dict_ldap did not properly initialize a handle
        after connection timeout. Problem reported by Alain Thivillon.
-       did not take his patch because I have no means to verify
-       the code. File: util/dict_ldap.c.
+       File: util/dict_ldap.c.
 
 20001214
 
        Feature: local_transport and default_transport now also
        understand the transport[:destination] notation, so that
-       transport parameters are similar again. File:
+       all transport config parameters are similar again. File:
        trivial-rewrite/resolve.c, trivial-rewrite/transport.c.
+
+       Code cleanup: mailbox_transport and fallback_transport no
+       longer allow the user to omit the transport part of a
+       transport:destination specification. That just did not make
+       any sense at all. The :destination part is still optional.
+       File: global/deliver_pass.c.
+
+       Feature: most time-related configuration parameters take
+       a one-letter suffix that specifies the time unit:  s
+       (second), m (minutes), h (hours), d (days), w (weeks).
+       "postconf -d" output includes the default time unit. Files:
+       many.
+
+       Code cleanup: in a CONFIG_TIME_TABLE, the default time unit
+       is now always the last character of a default time value.
+       It is no longer necessary to specify the default time unit
+       separately. This change means that it is not longer possible
+       to specify default values in the form of function calls.
+       Files: global/mail_conf_time.c, and user code.
index 5a312ef2854596506e5513dfd76557200cd292df..2fa074567ca98e6e9f32e4530b45cad6ea200300 100644 (file)
@@ -1,3 +1,21 @@
+Major changes with snapshot-20001215
+====================================
+
+This release involves little change in functionality and a lot of
+small changes to lots of files. The code is put out as a separate
+snapshot release so that I have a tested baseline for further work.
+
+All time-related configuration parameters now accept a one-letter
+suffix to indicate the time unit (s: second, m: minute, h: hour,
+d: day, w: week). The exceptions are the LDAP and MYSQL modules
+which are maintained separately.
+
+The local_transport and default_transport configuration parameters
+can now be specified in transport:destination notation, just like
+the mailbox_transport and fallback_transport parameters.  The
+:destination part is optional.  This change makes the relayhost
+parameter obsolescent.
+
 Incompatible changes with snapshot-20001210
 ===========================================
 
index 243c98bd4fce16a1ecd86611f0a42cb215e23d93..45c48921c74c0e7c540839b90a6aeec4490cc78a 100644 (file)
@@ -143,11 +143,15 @@ Instead of dGVzdAB0ZXN0AHRlc3RwYXNz, specify the base64 encoded
 form of username\0username\0password (the \0 is a null byte). The
 example above is for a user named `test' with password `testpass'.
 
-You can use e. g.: printf 'username\0username\0password' | mmencode 
-or perl -MMIME::Base64 -e 'print
-       encode_base64("username\0username\0password");'
-to get this output (MIME::Base64 is available from CPAN in case you
-don't have it).
+In order to generate base64 encoded authentication information you
+can use one of the following commands:
+
+    % printf 'username\0username\0password' | mmencode 
+
+    % perl -MMIME::Base64 -e \
+       'print encode_base64("username\0username\0password");'
+
+MIME::Base64 is available from www.cpan.org.
 
 Enabling SASL authentication in the Postfix SMTP client
 =======================================================
index 0b55f1ce330bee6814d43cc2c33118e09a154038..f171541f974fb7055ca43f2a6f614ae70781c7ad 100644 (file)
@@ -14,7 +14,10 @@ always_bcc =
 # take to handle a request before it assumes it is wedged and commits
 # suicide.
 #
-daemon_timeout = 18000
+# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
+# The default time unit is s (seconds).
+#
+daemon_timeout = 18000s
 
 # The default_database_type parameter specifies the default database
 # type to use in postalias(1) and postmap(1) commands. On many UNIX
@@ -117,7 +120,10 @@ ipc_idle = 100
 # of deadlock situations. If the timeout is exceeded the software
 # aborts with a fatal error.
 #
-ipc_timeout = 3600
+# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
+# The default time unit is s (seconds).
+#
+#ipc_timeout = 3600s
 
 # The mail_name parameter specifies the mail system name that is used
 # in Received: headers, in the SMTP greeting banner, and in bounced
@@ -333,10 +339,16 @@ syslog_facility = mail
 # a Postfix daemon. This prevents programs from getting stuck when the
 # mail system is under heavy load.
 #
-trigger_timeout = 10
+# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
+# The default time unit is s (seconds).
+#
+trigger_timeout = 10s
 
 # The delay_warning_time specifies after how many hours a warning
 # is sent that mail has not yet been delivered. By default, no warning
 # is sent.
 #
-# delay_warning_time = 0
+# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
+# The default time unit is h (hours).
+#
+# delay_warning_time = 0h
index 28ccc19b24b1ba83376a770cfc6c807b47acd534..05cf5bf5aea4130fffedaa5014850fce3ea1b706 100644 (file)
@@ -36,7 +36,10 @@ maximal_backoff_time = 4000
 # The maximal_queue_lifetime parameter specifies the maximal time in
 # days a message is queued before it is sent back as undeliverable.
 #
-maximal_queue_lifetime = 5
+# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
+# The default time unit is d (days).
+#
+maximal_queue_lifetime = 5d
 
 # The minimal_backoff_time parameter specifies the minimal time in
 # seconds between attempts to deliver a deferred message.  This
@@ -48,7 +51,10 @@ minimal_backoff_time = 1000
 # The queue_run_delay parameter specifies the time in seconds
 # between deferred queue scans by the queue manager.
 #
-queue_run_delay = 1000
+# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
+# The default time unit is s (seconds).
+#
+queue_run_delay = 1000s
 
 # The defer_transports parameter specifies the names of transports
 # that should not be delivered to unless someone issues "sendmail
index aecc31200f4a85ddb2c2f1ed72a32a952d8193ff..2e4ba8b9066173a68fa63309f50c49fb89969fa2 100644 (file)
@@ -36,7 +36,10 @@ deliver_lock_attempts = 5
 # The deliver_lock_delay parameter limits the time in seconds between
 # attempts to acquire an exclusive lock.
 #
-deliver_lock_delay = 1
+# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
+# The default time unit is s (seconds).
+#
+deliver_lock_delay = 1s
 
 # The duplicate_filter_limit parameter limits the number of addresses
 # remembered by the duplicate filter for alias, virtual, etc.
@@ -52,7 +55,10 @@ fork_attempts = 5
 # The fork_delay parameter specifies the delay in seconds between
 # fork() attempts.
 #
-fork_delay = 1
+# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
+# The default time unit is s (seconds).
+#
+fork_delay = 1s
 
 # The header_size_limit parameter limits the amount of memory in
 # bytes used for processing a message header. If a header is larger,
index 680c714bdaf7726d76f10aa327e2c23931ef2113..a5f0e184b8f8ad0a3809de154e71363b94d791ff 100644 (file)
@@ -114,8 +114,11 @@ smtp_destination_recipient_limit = $default_destination_recipient_limit
 # tries the next address on the mail exchanger list. Specify 0 to
 # disable the timeout.
 #
-# smtp_connect_timeout = 30
-smtp_connect_timeout = 0
+# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
+# The default time unit is s (seconds).
+#
+# smtp_connect_timeout = 30s
+smtp_connect_timeout = 0s
 
 # The smtp_helo_timeout parameter specifies the SMTP client timeout
 # in seconds for receiving the SMTP greeting banner.
@@ -124,7 +127,10 @@ smtp_connect_timeout = 0
 # banner, or when it sends no greeting banner within the deadline,
 # the SMTP client tries the next address on the mail exchanger list.
 #
-smtp_helo_timeout = 300
+# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
+# The default time unit is s (seconds).
+#
+smtp_helo_timeout = 300s
 
 # The smtp_mail_timeout parameter specifies the SMTP client timeout
 # in seconds for sending the SMTP MAIL FROM command, and for receiving
@@ -133,7 +139,10 @@ smtp_helo_timeout = 300
 # In case of problems the client does NOT try the next address on
 # the mail exchanger list.
 #
-smtp_mail_timeout = 300
+# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
+# The default time unit is s (seconds).
+#
+smtp_mail_timeout = 300s
 
 # The smtp_rcpt_timeout parameter specifies the SMTP client timeout
 # in seconds for sending the SMTP RCPT TO command, and for receiving
@@ -142,7 +151,10 @@ smtp_mail_timeout = 300
 # In case of problems the client does NOT try the next address on
 # the mail exchanger list.
 #
-smtp_rcpt_timeout = 300
+# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
+# The default time unit is s (seconds).
+#
+smtp_rcpt_timeout = 300s
 
 # The smtp_data_init_timeout parameter specifies the SMTP client
 # timeout in seconds for sending the SMTP DATA command, and for
@@ -151,7 +163,10 @@ smtp_rcpt_timeout = 300
 # In case of problems the client does NOT try the next address on
 # the mail exchanger list.
 #
-smtp_data_init_timeout = 120
+# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
+# The default time unit is s (seconds).
+#
+smtp_data_init_timeout = 120s
 
 # The smtp_data_xfer_timeout parameter specifies the SMTP client
 # timeout in seconds for sending the SMTP message content. When
@@ -161,7 +176,10 @@ smtp_data_init_timeout = 120
 # In case of problems the client does NOT try the next address on
 # the mail exchanger list.
 #
-smtp_data_xfer_timeout = 180
+# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
+# The default time unit is s (seconds).
+#
+smtp_data_xfer_timeout = 180s
 
 # The smtp_data_done_timeout parameter specifies the SMTP client
 # timeout in seconds for sending the SMTP ".", and for receiving
@@ -173,10 +191,16 @@ smtp_data_xfer_timeout = 180
 # In case of problems the client does NOT try the next address on
 # the mail exchanger list.
 #
-smtp_data_done_timeout = 600
+# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
+# The default time unit is s (seconds).
+#
+smtp_data_done_timeout = 600s
 
 # The smtp_quit_timeout parameter specifies the SMTP client timeout
 # in seconds for sending the SMTP QUIT command, and for receiving
 # the server response.
 #
-smtp_quit_timeout = 300
+# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
+# The default time unit is s (seconds).
+#
+smtp_quit_timeout = 300s
index 0539cc551bcc3ee23e251fa7dfbbbfd52af6772d..3e31c0bdd1128c9c2264343e5b475b9cf454bf9a 100644 (file)
@@ -58,7 +58,10 @@ smtpd_recipient_limit = 1000
 # Note: if you set SMTP timeouts to large values you must update the
 # global ipc_timeout parameter as well. See sample-misc.cf for details.
 #
-smtpd_timeout = 300
+# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
+# The default time unit is s (seconds).
+#
+smtpd_timeout = 300s
 
 #
 # TARPIT CONTROLS
index 4baf9091854d5f50153ac4b4531425943c192064..eeedb7b141b09a67c21715606f6f975027457602 100644 (file)
@@ -283,8 +283,8 @@ int     main(int argc, char **argv)
        0,
     };
     static CONFIG_TIME_TABLE time_table[] = {
-       VAR_MAX_QUEUE_TIME, DEF_MAX_QUEUE_TIME, &var_max_queue_time, 'd', 1, 1000,
-       VAR_DELAY_WARN_TIME, DEF_DELAY_WARN_TIME, &var_delay_warn_time, 'h', 0, 0,
+       VAR_MAX_QUEUE_TIME, DEF_MAX_QUEUE_TIME, &var_max_queue_time, 1, 8640000,
+       VAR_DELAY_WARN_TIME, DEF_DELAY_WARN_TIME, &var_delay_warn_time, 0, 0,
        0,
     };
     static CONFIG_STR_TABLE str_table[] = {
index 3bc111dec5c5f555e98fef4a4b0455b06f67a135..0cb5812c5bca85781931d5018fc3c17dfb00824b 100644 (file)
@@ -116,7 +116,7 @@ CONFIG_INT_TABLE cleanup_int_table[] = {
 };
 
 CONFIG_TIME_TABLE cleanup_time_table[] = {
-    VAR_DELAY_WARN_TIME, DEF_DELAY_WARN_TIME, &var_delay_warn_time, 'h', 0, 0,
+    VAR_DELAY_WARN_TIME, DEF_DELAY_WARN_TIME, &var_delay_warn_time, 0, 0,
     0,
 };
 
index 8f284a0d946552ebfa92094541292bb978fea167..0ec9840d972d3964f32a436498564e6e6bbdf9d4 100644 (file)
@@ -507,8 +507,8 @@ static void pre_jail_init(char *unused_name, char **unused_argv)
 int     main(int argc, char **argv)
 {
     static CONFIG_TIME_TABLE time_table[] = {
-       VAR_FFLUSH_REFRESH, DEF_FFLUSH_REFRESH, &var_fflush_refresh, 'h', 1, 0,
-       VAR_FFLUSH_PURGE, DEF_FFLUSH_PURGE, &var_fflush_purge, 'd', 1, 0,
+       VAR_FFLUSH_REFRESH, DEF_FFLUSH_REFRESH, &var_fflush_refresh, 1, 0,
+       VAR_FFLUSH_PURGE, DEF_FFLUSH_PURGE, &var_fflush_purge, 1, 0,
        0,
     };
 
index 60bd859e220600bf0a58b675d65904e8164f0512..1a1ae3e3f73085bdf453feca3a38bb6fa25e4233 100644 (file)
@@ -46,11 +46,11 @@ 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_time(const char *, const char *, int, int, int);
+extern int get_mail_conf_time(const char *, const char *, int, int);
 extern char *get_mail_conf_raw(const char *, const char *, int, int);
 
 extern int get_mail_conf_int2(const char *, const char *, int, int, int);
-extern int get_mail_conf_time2(const char *, const char *, const char *, int, int, int);
+extern int get_mail_conf_time2(const char *, const char *, const char *, int, int);
 
  /*
   * Lookup with function-call defaults.
@@ -97,9 +97,8 @@ typedef struct {
 
 typedef struct {
     const char *name;                  /* config variable name */
-    const char *defval;                        /* default value */
+    const char *defval;                        /* default value + default unit */
     int    *target;                    /* pointer to global variable */
-    int     def_unit;                  /* default unit: s|m|h|d|w */
     int     min;                       /* lower bound or zero */
     int     max;                       /* upper bound or zero */
 } CONFIG_TIME_TABLE;
@@ -136,19 +135,9 @@ typedef struct {
     int    *target;                    /* pointer to global variable */
 } CONFIG_BOOL_FN_TABLE;
 
-typedef struct {
-    const char *name;                  /* config variable name */
-    const char *(*defval) (void);      /* default value provider */
-    int    *target;                    /* pointer to global variable */
-    int     def_unit;                  /* default unit: s|m|h|d|w */
-    int     min;                       /* lower bound or zero */
-    int     max;                       /* upper bound or zero */
-} CONFIG_TIME_FN_TABLE;
-
 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_time_fn_table(CONFIG_TIME_FN_TABLE *);
 extern void get_mail_conf_raw_fn_table(CONFIG_STR_FN_TABLE *);
 
 /* LICENSE
index dafd836cfc00a61650fddc59e24dd608088f7a4f..af696544b2ceafeb56d76488bef67b407aaea775 100644 (file)
@@ -6,17 +6,9 @@
 /* SYNOPSIS
 /*     #include <mail_conf.h>
 /*
-/*     int     get_mail_conf_time(name, defval, def_unit, min, max);
+/*     int     get_mail_conf_time(name, defval, min, max);
 /*     const char *name;
 /*     const char *defval;
-/*     int     def_unit;
-/*     int     min;
-/*     int     max;
-/*
-/*     int     get_mail_conf_time_fn(name, defval, def_unit, min, max);
-/*     const char *name;
-/*     const char *(*defval)();
-/*     int     def_unit;
 /*     int     min;
 /*     int     max;
 /*
 /*     const char *value;
 /*
 /*     void    get_mail_conf_time_table(table)
-/*     CONFIG_INT_TABLE *table;
-/*
-/*     void    get_mail_conf_time_fn_table(table)
-/*     CONFIG_INT_TABLE *table;
+/*     CONFIG_TIME_TABLE *table;
 /* AUXILIARY FUNCTIONS
-/*     int     get_mail_conf_time2(name1, name2, defval, def_unit, min, max);
+/*     int     get_mail_conf_time2(name1, name2, defval, min, max);
 /*     const char *name1;
 /*     const char *name2;
-/*     const char *defval;
 /*     int     def_unit;
 /*     int     min;
 /*     int     max;
@@ -42,6 +30,7 @@
 /*     for time interval values. The conversion routines understand
 /*     one-letter suffixes to specify an explicit time unit: s
 /*     (seconds), m (minutes), h (hours), d (days) or w (weeks).
+/*     Internally, time is represented in seconds.
 /*
 /*     get_mail_conf_time() looks up the named entry in the global
 /*     configuration dictionary. The default value is returned
 /*     value or string length; \fImax\fR is zero or specifies an
 /*     upper limit on the integer value or string length.
 /*
-/*     get_mail_conf_time_fn() is similar but specifies a function that
-/*     provides the default value. The function is called only
-/*     when the default value is needed.
-/*
 /*     set_mail_conf_time() updates the named entry in the global
 /*     configuration dictionary. This has no effect on values that
 /*     have been looked up earlier via the get_mail_conf_XXX() routines.
 /*     get_mail_conf_time_table() and get_mail_conf_time_fn_table() initialize
 /*     lists of variables, as directed by their table arguments. A table
 /*     must be terminated by a null entry.
-/*
-/*     get_mail_conf_time2() concatenates the two names and is otherwise
-/*     identical to get_mail_conf_time().
 /* DIAGNOSTICS
 /*     Fatal errors: malformed numerical value, unknown time unit.
+/* BUGS
+/*     Values and defaults are given in any unit; upper and lower
+/*     bounds are given in seconds.
 /* SEE ALSO
 /*     config(3) general configuration
 /*     mail_conf_str(3) string-valued configuration parameters
@@ -86,6 +71,7 @@
 #include <sys_defs.h>
 #include <stdlib.h>
 #include <stdio.h>                     /* sscanf() */
+#include <ctype.h>
 
 /* Utility library. */
 
@@ -111,31 +97,31 @@ static int convert_mail_conf_time(const char *name, int *intval, int def_unit)
     char    unit;
     char    junk;
 
-    if ((strval = mail_conf_lookup_eval(name)) != 0) {
-       switch (sscanf(strval, "%d%c%c", intval, &unit, &junk)) {
-       case 1:
-           unit = def_unit;
-       case 2:
-           switch (unit) {
-           case 'w':
-               *intval *= WEEK;
-               return (1);
-           case 'd':
-               *intval *= DAY;
-               return (1);
-           case 'h':
-               *intval *= HOUR;
-               return (1);
-           case 'm':
-               *intval *= MINUTE;
-               return (1);
-           case 's':
-               return (1);
-           }
+    if ((strval = mail_conf_lookup_eval(name)) == 0)
+       return (0);
+
+    switch (sscanf(strval, "%d%c%c", intval, &unit, &junk)) {
+    case 1:
+       unit = def_unit;
+    case 2:
+       switch (unit) {
+       case 'w':
+           *intval *= WEEK;
+           return (1);
+       case 'd':
+           *intval *= DAY;
+           return (1);
+       case 'h':
+           *intval *= HOUR;
+           return (1);
+       case 'm':
+           *intval *= MINUTE;
+           return (1);
+       case 's':
+           return (1);
        }
-       msg_fatal("bad time configuration: %s = %s", name, strval);
     }
-    return (0);
+    msg_fatal("bad time parameter configuration: %s = %s", name, strval);
 }
 
 /* check_mail_conf_time - validate integer value */
@@ -148,12 +134,33 @@ static void check_mail_conf_time(const char *name, int intval, int min, int max)
        msg_fatal("invalid %s: %d (max %d)", name, intval, max);
 }
 
+/* get_def_time_unit - extract time unit from default value */
+
+static int get_def_time_unit(const char *name, const char *defval)
+{
+    const char *cp;
+
+    for (cp = defval; /* void */ ; cp++) {
+       if (*cp == 0)
+           msg_panic("parameter %s: missing time unit in default value: %s",
+                     name, defval);
+       if (ISALPHA(*cp)) {
+           if (cp[1] != 0)
+               msg_panic("parameter %s: bad time unit in default value: %s",
+                         name, defval);
+           return (*cp);
+       }
+    }
+}
+
 /* get_mail_conf_time - evaluate integer-valued configuration variable */
 
-int     get_mail_conf_time(const char *name, const char *defval, int def_unit, int min, int max)
+int     get_mail_conf_time(const char *name, const char *defval, int min, int max)
 {
     int     intval;
+    int     def_unit;
 
+    def_unit = get_def_time_unit(name, defval);
     if (convert_mail_conf_time(name, &intval, def_unit) == 0)
        set_mail_conf_time(name, defval);
     if (convert_mail_conf_time(name, &intval, def_unit) == 0)
@@ -165,12 +172,14 @@ int     get_mail_conf_time(const char *name, const char *defval, int def_unit, i
 /* get_mail_conf_time2 - evaluate integer-valued configuration variable */
 
 int     get_mail_conf_time2(const char *name1, const char *name2,
-                        const char *defval, int def_unit, int min, int max)
+                                   const char *defval, int min, int max)
 {
     int     intval;
     char   *name;
+    int     def_unit;
 
     name = concatenate(name1, name2, (char *) 0);
+    def_unit = get_def_time_unit(name, defval);
     if (convert_mail_conf_time(name, &intval, def_unit) == 0)
        set_mail_conf_time(name, defval);
     if (convert_mail_conf_time(name, &intval, def_unit) == 0)
@@ -180,23 +189,6 @@ int     get_mail_conf_time2(const char *name1, const char *name2,
     return (intval);
 }
 
-/* get_mail_conf_time_fn - evaluate integer-valued configuration variable */
-
-typedef const char *(*stupid_indent_time) (void);
-
-int     get_mail_conf_time_fn(const char *name, stupid_indent_time defval,
-                                     int def_unit, int min, int max)
-{
-    int     intval;
-
-    if (convert_mail_conf_time(name, &intval, def_unit) == 0)
-       set_mail_conf_time(name, defval());
-    if (convert_mail_conf_time(name, &intval, def_unit) == 0)
-       msg_panic("get_mail_conf_time_fn: parameter not found: %s", name);
-    check_mail_conf_time(name, intval, min, max);
-    return (intval);
-}
-
 /* set_mail_conf_time - update integer-valued configuration dictionary entry */
 
 void    set_mail_conf_time(const char *name, const char *value)
@@ -210,18 +202,7 @@ void    get_mail_conf_time_table(CONFIG_TIME_TABLE *table)
 {
     while (table->name) {
        table->target[0] = get_mail_conf_time(table->name, table->defval,
-                                  table->def_unit, table->min, table->max);
-       table++;
-    }
-}
-
-/* get_mail_conf_time_fn_table - look up integers, defaults are functions */
-
-void    get_mail_conf_time_fn_table(CONFIG_TIME_FN_TABLE *table)
-{
-    while (table->name) {
-       table->target[0] = get_mail_conf_time_fn(table->name, table->defval,
-                                  table->def_unit, table->min, table->max);
+                                             table->min, table->max);
        table++;
     }
 }
index 77c720ad6f17529856c850f71321860e944c8253..fb604671a7f2e4fae513fdc525903d6cf487ccf9 100644 (file)
@@ -307,14 +307,14 @@ void    mail_params_init()
        0,
     };
     static CONFIG_TIME_TABLE time_defaults[] = {
-       VAR_MAX_IDLE, DEF_MAX_IDLE, &var_idle_limit, 's', 1, 0,
-       VAR_IPC_IDLE, DEF_IPC_IDLE, &var_ipc_idle_limit, 's', 1, 0,
-       VAR_IPC_TIMEOUT, DEF_IPC_TIMEOUT, &var_ipc_timeout, 's', 1, 0,
-       VAR_TRIGGER_TIMEOUT, DEF_TRIGGER_TIMEOUT, &var_trigger_timeout, 's', 1, 0,
-       VAR_FLOCK_DELAY, DEF_FLOCK_DELAY, &var_flock_delay, 's', 1, 0,
-       VAR_FLOCK_STALE, DEF_FLOCK_STALE, &var_flock_stale, 's', 1, 0,
-       VAR_FORK_DELAY, DEF_FORK_DELAY, &var_fork_delay, 's', 1, 0,
-       VAR_DAEMON_TIMEOUT, DEF_DAEMON_TIMEOUT, &var_daemon_timeout, 's', 1, 0,
+       VAR_MAX_IDLE, DEF_MAX_IDLE, &var_idle_limit, 1, 0,
+       VAR_IPC_IDLE, DEF_IPC_IDLE, &var_ipc_idle_limit, 1, 0,
+       VAR_IPC_TIMEOUT, DEF_IPC_TIMEOUT, &var_ipc_timeout, 1, 0,
+       VAR_TRIGGER_TIMEOUT, DEF_TRIGGER_TIMEOUT, &var_trigger_timeout, 1, 0,
+       VAR_FLOCK_DELAY, DEF_FLOCK_DELAY, &var_flock_delay, 1, 0,
+       VAR_FLOCK_STALE, DEF_FLOCK_STALE, &var_flock_stale, 1, 0,
+       VAR_FORK_DELAY, DEF_FORK_DELAY, &var_fork_delay, 1, 0,
+       VAR_DAEMON_TIMEOUT, DEF_DAEMON_TIMEOUT, &var_daemon_timeout, 1, 0,
        0,
     };
     static CONFIG_BOOL_TABLE bool_defaults[] = {
index bf0df24ef9426dd792ba20711ef9b8e6133842be..788b640c6d457f1afa1f44819ea8fe972492ea8c 100644 (file)
@@ -15,7 +15,7 @@
   * Version of this program.
   */
 #define VAR_MAIL_VERSION       "mail_version"
-#define DEF_MAIL_VERSION       "Snapshot-20001214"
+#define DEF_MAIL_VERSION       "Snapshot-20001215"
 extern char *var_mail_version;
 
 /* LICENSE
index ac289014c57b435acac113abd2cfa8efa1a08116..7796d875fd4d914f019222278233c19b7c7bee61 100644 (file)
@@ -471,15 +471,15 @@ int     main(int argc, char **argv)
        0,
     };
     static CONFIG_TIME_TABLE time_table[] = {
-       VAR_LMTP_CONN_TMOUT, DEF_LMTP_CONN_TMOUT, &var_lmtp_conn_tmout, 's', 0, 0,
-       VAR_LMTP_RSET_TMOUT, DEF_LMTP_RSET_TMOUT, &var_lmtp_rset_tmout, 's', 1, 0,
-       VAR_LMTP_LHLO_TMOUT, DEF_LMTP_LHLO_TMOUT, &var_lmtp_lhlo_tmout, 's', 1, 0,
-       VAR_LMTP_MAIL_TMOUT, DEF_LMTP_MAIL_TMOUT, &var_lmtp_mail_tmout, 's', 1, 0,
-       VAR_LMTP_RCPT_TMOUT, DEF_LMTP_RCPT_TMOUT, &var_lmtp_rcpt_tmout, 's', 1, 0,
-       VAR_LMTP_DATA0_TMOUT, DEF_LMTP_DATA0_TMOUT, &var_lmtp_data0_tmout, 's', 1, 0,
-       VAR_LMTP_DATA1_TMOUT, DEF_LMTP_DATA1_TMOUT, &var_lmtp_data1_tmout, 's', 1, 0,
-       VAR_LMTP_DATA2_TMOUT, DEF_LMTP_DATA2_TMOUT, &var_lmtp_data2_tmout, 's', 1, 0,
-       VAR_LMTP_QUIT_TMOUT, DEF_LMTP_QUIT_TMOUT, &var_lmtp_quit_tmout, 's', 1, 0,
+       VAR_LMTP_CONN_TMOUT, DEF_LMTP_CONN_TMOUT, &var_lmtp_conn_tmout, 0, 0,
+       VAR_LMTP_RSET_TMOUT, DEF_LMTP_RSET_TMOUT, &var_lmtp_rset_tmout, 1, 0,
+       VAR_LMTP_LHLO_TMOUT, DEF_LMTP_LHLO_TMOUT, &var_lmtp_lhlo_tmout, 1, 0,
+       VAR_LMTP_MAIL_TMOUT, DEF_LMTP_MAIL_TMOUT, &var_lmtp_mail_tmout, 1, 0,
+       VAR_LMTP_RCPT_TMOUT, DEF_LMTP_RCPT_TMOUT, &var_lmtp_rcpt_tmout, 1, 0,
+       VAR_LMTP_DATA0_TMOUT, DEF_LMTP_DATA0_TMOUT, &var_lmtp_data0_tmout, 1, 0,
+       VAR_LMTP_DATA1_TMOUT, DEF_LMTP_DATA1_TMOUT, &var_lmtp_data1_tmout, 1, 0,
+       VAR_LMTP_DATA2_TMOUT, DEF_LMTP_DATA2_TMOUT, &var_lmtp_data2_tmout, 1, 0,
+       VAR_LMTP_QUIT_TMOUT, DEF_LMTP_QUIT_TMOUT, &var_lmtp_quit_tmout, 1, 0,
        0,
     };
     static CONFIG_BOOL_TABLE bool_table[] = {
index 4f2b19e4962481db63a4a356b70cca1a69b5612a..8bb502c0fd61898ab4c4c9e7f6c629f9850d531d 100644 (file)
@@ -626,7 +626,7 @@ static void post_init(char *unused_name, char **unused_argv)
 int     main(int argc, char **argv)
 {
     static CONFIG_TIME_TABLE time_table[] = {
-       VAR_COMMAND_MAXTIME, DEF_COMMAND_MAXTIME, &var_command_maxtime, 's', 1, 0,
+       VAR_COMMAND_MAXTIME, DEF_COMMAND_MAXTIME, &var_command_maxtime, 1, 0,
        0,
     };
     static CONFIG_INT_TABLE int_table[] = {
index ebd599d3c9e07684e9c156726724fb5cc9b5759b..ad4480b13d293e4cef77d9c3e2beee46b2484f67 100644 (file)
@@ -58,7 +58,7 @@ void    master_vars_init(void)
        0,
     };
     static CONFIG_TIME_TABLE time_table[] = {
-       VAR_THROTTLE_TIME, DEF_THROTTLE_TIME, &var_throttle_time, 's', 1, 0,
+       VAR_THROTTLE_TIME, DEF_THROTTLE_TIME, &var_throttle_time, 1, 0,
        0,
     };
 
index a5fbfa9181d6d13976b4fba869dc7212a5926226..c7cbd62c5c651ad986790e11aeee6d47b8d3b794 100644 (file)
@@ -510,11 +510,11 @@ int     main(int argc, char **argv)
        0,
     };
     static CONFIG_TIME_TABLE time_table[] = {
-       VAR_QUEUE_RUN_DELAY, DEF_QUEUE_RUN_DELAY, &var_queue_run_delay, 's', 1, 0,
-       VAR_MIN_BACKOFF_TIME, DEF_MIN_BACKOFF_TIME, &var_min_backoff_time, 's', 1, 0,
-       VAR_MAX_BACKOFF_TIME, DEF_MAX_BACKOFF_TIME, &var_max_backoff_time, 's', 1, 0,
-       VAR_MAX_QUEUE_TIME, DEF_MAX_QUEUE_TIME, &var_max_queue_time, 'd', 1, 8640000,
-       VAR_XPORT_RETRY_TIME, DEF_XPORT_RETRY_TIME, &var_transport_retry_time, 's', 1, 0,
+       VAR_QUEUE_RUN_DELAY, DEF_QUEUE_RUN_DELAY, &var_queue_run_delay, 1, 0,
+       VAR_MIN_BACKOFF_TIME, DEF_MIN_BACKOFF_TIME, &var_min_backoff_time, 1, 0,
+       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, 8640000,
+       VAR_XPORT_RETRY_TIME, DEF_XPORT_RETRY_TIME, &var_transport_retry_time, 1, 0,
        0,
     };
     static CONFIG_INT_TABLE int_table[] = {
index 2f13074d6d064c4984bf1b1e197afb028e738533..60c1fb48e828e231a36ae5a48565ed9d55402ccf 100644 (file)
@@ -767,7 +767,7 @@ static void drop_privileges(char *unused_name, char **unused_argv)
 int     main(int argc, char **argv)
 {
     static CONFIG_TIME_TABLE time_table[] = {
-       VAR_COMMAND_MAXTIME, DEF_COMMAND_MAXTIME, &var_command_maxtime, 's', 1, 0,
+       VAR_COMMAND_MAXTIME, DEF_COMMAND_MAXTIME, &var_command_maxtime, 1, 0,
        0,
     };
 
index 3a9d9c2b5a8c3a28b3975fad0149e1f72fcf8d6d..10bb928d9064a36dcac9c2089e844a40084a07a7 100644 (file)
@@ -476,18 +476,6 @@ static void print_bool(int mode, CONFIG_BOOL_TABLE *cbt)
 static void print_time(int mode, CONFIG_TIME_TABLE *ctt)
 {
     const char *value;
-    const char *ptr;
-
-    /*
-     * Make sure the default unit matches the default value unit.
-     */
-    for (ptr = ctt->defval; ptr[1] != 0; ptr += 1)
-        /* void */ ;
-    if (*ptr == 0)
-       msg_fatal("parameter %s has void default value", ctt->name);
-    if (ctt->def_unit != *ptr)
-       msg_fatal("parameter %s has default value %s but default unit %c",
-                 ctt->name, ctt->defval, ctt->def_unit);
 
     if (mode & SHOW_DEFS) {
        show_strval(mode, ctt->name, ctt->defval);
index af6759542b13cbc41bf58bdd6150cf04dff5e702..97488cd63cc858d791f5bbfac5ad6681e2442a5c 100644 (file)
@@ -473,11 +473,11 @@ int     main(int argc, char **argv)
        0,
     };
     static CONFIG_TIME_TABLE time_table[] = {
-       VAR_QUEUE_RUN_DELAY, DEF_QUEUE_RUN_DELAY, &var_queue_run_delay, 's', 1, 0,
-       VAR_MIN_BACKOFF_TIME, DEF_MIN_BACKOFF_TIME, &var_min_backoff_time, 's', 1, 0,
-       VAR_MAX_BACKOFF_TIME, DEF_MAX_BACKOFF_TIME, &var_max_backoff_time, 's', 1, 0,
-       VAR_MAX_QUEUE_TIME, DEF_MAX_QUEUE_TIME, &var_max_queue_time, 'd', 1, 8640000,
-       VAR_XPORT_RETRY_TIME, DEF_XPORT_RETRY_TIME, &var_transport_retry_time, 's', 1, 0,
+       VAR_QUEUE_RUN_DELAY, DEF_QUEUE_RUN_DELAY, &var_queue_run_delay, 1, 0,
+       VAR_MIN_BACKOFF_TIME, DEF_MIN_BACKOFF_TIME, &var_min_backoff_time, 1, 0,
+       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, 8640000,
+       VAR_XPORT_RETRY_TIME, DEF_XPORT_RETRY_TIME, &var_transport_retry_time, 1, 0,
        0,
     };
     static CONFIG_INT_TABLE int_table[] = {
index 2ccd504a6c89df5d631e27782941a607fa09c036..12639ae0ae5f6a8534a90214548030760259467f 100644 (file)
@@ -402,14 +402,14 @@ int     main(int argc, char **argv)
        0,
     };
     static CONFIG_TIME_TABLE time_table[] = {
-       VAR_SMTP_CONN_TMOUT, DEF_SMTP_CONN_TMOUT, &var_smtp_conn_tmout, 's', 0, 0,
-       VAR_SMTP_HELO_TMOUT, DEF_SMTP_HELO_TMOUT, &var_smtp_helo_tmout, 's', 1, 0,
-       VAR_SMTP_MAIL_TMOUT, DEF_SMTP_MAIL_TMOUT, &var_smtp_mail_tmout, 's', 1, 0,
-       VAR_SMTP_RCPT_TMOUT, DEF_SMTP_RCPT_TMOUT, &var_smtp_rcpt_tmout, 's', 1, 0,
-       VAR_SMTP_DATA0_TMOUT, DEF_SMTP_DATA0_TMOUT, &var_smtp_data0_tmout, 's', 1, 0,
-       VAR_SMTP_DATA1_TMOUT, DEF_SMTP_DATA1_TMOUT, &var_smtp_data1_tmout, 's', 1, 0,
-       VAR_SMTP_DATA2_TMOUT, DEF_SMTP_DATA2_TMOUT, &var_smtp_data2_tmout, 's', 1, 0,
-       VAR_SMTP_QUIT_TMOUT, DEF_SMTP_QUIT_TMOUT, &var_smtp_quit_tmout, 's', 1, 0,
+       VAR_SMTP_CONN_TMOUT, DEF_SMTP_CONN_TMOUT, &var_smtp_conn_tmout, 0, 0,
+       VAR_SMTP_HELO_TMOUT, DEF_SMTP_HELO_TMOUT, &var_smtp_helo_tmout, 1, 0,
+       VAR_SMTP_MAIL_TMOUT, DEF_SMTP_MAIL_TMOUT, &var_smtp_mail_tmout, 1, 0,
+       VAR_SMTP_RCPT_TMOUT, DEF_SMTP_RCPT_TMOUT, &var_smtp_rcpt_tmout, 1, 0,
+       VAR_SMTP_DATA0_TMOUT, DEF_SMTP_DATA0_TMOUT, &var_smtp_data0_tmout, 1, 0,
+       VAR_SMTP_DATA1_TMOUT, DEF_SMTP_DATA1_TMOUT, &var_smtp_data1_tmout, 1, 0,
+       VAR_SMTP_DATA2_TMOUT, DEF_SMTP_DATA2_TMOUT, &var_smtp_data2_tmout, 1, 0,
+       VAR_SMTP_QUIT_TMOUT, DEF_SMTP_QUIT_TMOUT, &var_smtp_quit_tmout, 1, 0,
        0,
     };
     static CONFIG_INT_TABLE int_table[] = {
index fd7e6c494bcf38c82f2e22e2230f3e2b541f8a30..6f4703ed4642070354edc2b2f2dc271d27260a7d 100644 (file)
@@ -1436,8 +1436,8 @@ int     main(int argc, char **argv)
        0,
     };
     static CONFIG_TIME_TABLE time_table[] = {
-       VAR_SMTPD_TMOUT, DEF_SMTPD_TMOUT, &var_smtpd_tmout, 's', 1, 0,
-       VAR_SMTPD_ERR_SLEEP, DEF_SMTPD_ERR_SLEEP, &var_smtpd_err_sleep, 's', 0, 0,
+       VAR_SMTPD_TMOUT, DEF_SMTPD_TMOUT, &var_smtpd_tmout, 1, 0,
+       VAR_SMTPD_ERR_SLEEP, DEF_SMTPD_ERR_SLEEP, &var_smtpd_err_sleep, 0, 0,
        0,
     };
     static CONFIG_BOOL_TABLE bool_table[] = {
index 361ca511f3977abfa5d9b60b35ee1ea91712a3e8..b63a63b78370a06a93843f98231b2c5c014e85d0 100644 (file)
@@ -299,7 +299,7 @@ static void drop_privileges(char *unused_name, char **unused_argv)
 int     main(int argc, char **argv)
 {
     static CONFIG_TIME_TABLE time_table[] = {
-       VAR_COMMAND_MAXTIME, DEF_COMMAND_MAXTIME, &var_command_maxtime, 's', 1, 0,
+       VAR_COMMAND_MAXTIME, DEF_COMMAND_MAXTIME, &var_command_maxtime, 1, 0,
        0,
     };
 
index 62e677728b8ac7538d869a813b09b6907595de21..baf55f69963511baaf14893529456e898f40b930 100644 (file)
@@ -81,7 +81,7 @@ void    transport_init(void)
 
 /* transport_lookup - map a transport domain */
 
-int     transport_lookup(const char *domain, VSTRING * channel, VSTRING * nexthop)
+int     transport_lookup(const char *domain, VSTRING *channel, VSTRING *nexthop)
 {
     char   *low_domain = lowercase(mystrdup(domain));
     const char *name;
@@ -122,6 +122,9 @@ int     transport_lookup(const char *domain, VSTRING * channel, VSTRING * nextho
                transport = var_def_transport;
            vstring_strcpy(channel, transport);
            (void) split_at(vstring_str(channel), ':');
+           if (*vstring_str(channel) == 0)
+               msg_fatal("null transport is not allowed: %s = %s",
+                         VAR_DEF_TRANSPORT, var_def_transport);
            vstring_strcpy(nexthop, host);
            myfree(saved_value);
            found = 1;
index fb3fa3dfa3b35140325d9fa66dd7fad56ad8e608..0ebdd377b410c5b7cd2d5e7711f53f3f91b79bc3 100644 (file)
@@ -146,12 +146,30 @@ static int dict_ldap_connect(DICT_LDAP *dict_ldap)
     void    (*saved_alarm) (int);
     int     rc = 0;
 
+#ifdef LDAP_OPT_NETWORK_TIMEOUT
+    struct timeval mytimeval;
+
+#endif
+
     dict_errno = 0;
 
     if (msg_verbose)
        msg_info("%s: Connecting to server %s", myname,
                 dict_ldap->server_host);
 
+#ifdef UNTESTED_LDAP_OPT_NETWORK_TIMEOUT
+    dict_ldap->ld = ldap_init(dict_ldap->server_host,
+                             (int) dict_ldap->server_port);
+    if (dict_ldap->ld == NULL) {
+       msg_warn("%s: Unable to int LDAP server %s",
+                myname, dict_ldap->server_host);
+       dict_errno = DICT_ERR_RETRY;
+       return (-1);
+    }
+    mytimeval.tv_sec = dict_ldap->timeout;
+    mytimeval.tv_usec = 0;
+    ldap_set_option(dict_ldap->ld, LDAP_OPT_NETWORK_TIMEOUT, &mytimeval);
+#else
     if ((saved_alarm = signal(SIGALRM, dict_ldap_timeout)) == SIG_ERR) {
        msg_warn("%s: Error setting signal handler for open timeout: %m",
                 myname);
@@ -178,6 +196,7 @@ static int dict_ldap_connect(DICT_LDAP *dict_ldap)
        dict_errno = DICT_ERR_RETRY;
        return (-1);
     }
+#endif
 
     /*
      * Configure alias dereferencing for this connection. Thanks to Mike