]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.9-20111117
authorWietse Venema <wietse@porcupine.org>
Thu, 17 Nov 2011 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:37:36 +0000 (06:37 +0000)
17 files changed:
postfix/.indent.pro
postfix/HISTORY
postfix/conf/main.cf
postfix/html/master.8.html
postfix/html/postconf.1.html
postfix/man/man1/postconf.1
postfix/man/man8/master.8
postfix/src/global/mail_version.h
postfix/src/master/master.c
postfix/src/postconf/Makefile.in
postfix/src/postconf/postconf.c
postfix/src/postconf/test6.ref [new file with mode: 0644]
postfix/src/postconf/test7.ref [new file with mode: 0644]
postfix/src/postconf/test8.ref [new file with mode: 0644]
postfix/src/smtpstone/smtp-sink.c
postfix/src/util/inet_proto.c
postfix/src/xsasl/xsasl_dovecot_server.c

index 76ec68cd60b243a4b632ae6f985fbcd8de416518..789741ca48476f734c63266e1dceee823c4cf129 100644 (file)
@@ -97,6 +97,7 @@
 -TDICT_REGEXP_RULE
 -TDICT_SDBM
 -TDICT_SQLITE
+-TDICT_STACK
 -TDICT_TCP
 -TDICT_TEXT
 -TDICT_UNIX
 -TNAME_CODE
 -TNAME_MASK
 -TNBBIO
+-TPC_SERVICE_DEF
+-TPC_STRING_NV
 -TPEER_NAME
 -TPGSQL_NAME
 -TPICKUP_INFO
 -TSSL_CTX
 -TSSL_SESSION
 -TSTRING_LIST
--TSTRING_NV
 -TSTRING_TABLE
 -TSYS_EXITS_DETAIL
 -TTLSMGR_SCACHE
index 13ef279d8e6eeb5a1f583654a5ede3fc775d5eaf..31a3b66c57efa1dcfcf94ecd6d4b9ba9d4db4497 100644 (file)
@@ -17075,3 +17075,20 @@ Apologies for any names omitted.
        Cleanup: documented the postconf algorithms and their
        limitations, and added regression tests to speed up future
        development. File: postconf/postconf.c
+
+20111117
+
+       Cleanup: postconf didn't "bless" type "inet" service names.
+
+       Cleanup: with pipelined sessions, smtp-sink flushed the
+       output too often. Reported by Mark Martinec. File:
+       smtpstone/smtp-sink.c.
+
+       Workaround: don't use IPv6 at build time. File: conf/main.cf.
+
+       Workaround: don't abort when IPv6 is present but busted.
+       File: util/inet_proto.c.
+
+       Portability: Dovecot now officially supports more socket
+       types for its authentication server. File:
+       xsasl/xsasl_dovecot_server.c.
index ca28c9319fa22f27ee3708837336cbe6f680edff..8d301aa986d5a6b5a54fe9f455534dc10d9d7e97 100644 (file)
@@ -654,3 +654,4 @@ sample_directory =
 # readme_directory: The location of the Postfix README files.
 #
 readme_directory =
+inet_protocols = ipv4
index f7875b583f675ba03ab03898fd416c45f0d504c6..db08b69fe43a60d14ec13b40afe2f05604ce1ff4 100644 (file)
@@ -186,7 +186,7 @@ MASTER(8)                                                            MASTER(8)
        <a href="qmgr.8.html">qmgr(8)</a>, queue manager
        <a href="verify.8.html">verify(8)</a>, address verification
        <a href="master.5.html">master(5)</a>, <a href="master.5.html">master.cf</a> configuration file syntax
-       <a href="postconf.5.html">postconf(5)</a>, <a href="postconf.5.html">main.cf</a> configuration parameter syntax
+       <a href="postconf.5.html">postconf(5)</a>, <a href="postconf.5.html">main.cf</a> configuration file syntax
        syslogd(8), system logging
 
 <b>LICENSE</b>
index b2ce99e84f176098acf4a39978a730b39cc96d7e..1b27e795b3c73bc3a7c1bf0f717853a1d0c3d9f1 100644 (file)
@@ -270,10 +270,10 @@ POSTCONF(1)                                                        POSTCONF(1)
        Problems are reported to the standard error stream.
 
 <b>BUGS</b>
-       There  currently  is  no support for per-service parameter
-       name spaces in  <a href="master.5.html">master.cf</a>.   This  means  that  "-o  user-
-       defined-name=value"  always  results in an "unused parame-
-       ter" warning.
+       <a href="postconf.1.html"><b>postconf</b>(1)</a>  may  log "unused parameter" warnings for <b>mas-</b>
+       <b>ter.cf</b>   entries   with   "-o    user-defined-name=value".
+       Addressing  this  limitation requires support for per-ser-
+       vice parameter name spaces.
 
 <b>ENVIRONMENT</b>
        <b>MAIL_CONFIG</b>
@@ -299,7 +299,8 @@ POSTCONF(1)                                                        POSTCONF(1)
 
 <b>SEE ALSO</b>
        <a href="bounce.5.html">bounce(5)</a>, bounce template file format
-       <a href="postconf.5.html">postconf(5)</a>, configuration parameters
+       <a href="master.5.html">master(5)</a>, <a href="master.5.html">master.cf</a> configuration file syntax
+       <a href="postconf.5.html">postconf(5)</a>, <a href="postconf.5.html">main.cf</a> configuration file syntax
 
 <b>README FILES</b>
        <a href="DATABASE_README.html">DATABASE_README</a>, Postfix lookup table overview
index b86bd9df51afdae6f5c9786a99463c263e6aa062..28d35f71b63e7cc1f6c4f86a35b34e64b216772b 100644 (file)
@@ -229,10 +229,10 @@ Problems are reported to the standard error stream.
 .SH BUGS
 .ad
 .fi
-There currently is no support for per-service parameter
-name spaces in master.cf.  This means that "-o
-user-defined-name=value" always results in an "unused
-parameter" warning.
+\fBpostconf\fR(1) may log "unused parameter" warnings for
+\fBmaster.cf\fR entries with "-o user-defined-name=value".
+Addressing this limitation requires support for per-service
+parameter name spaces.
 .SH "ENVIRONMENT"
 .na
 .nf
@@ -263,7 +263,8 @@ Pathname of a configuration file with bounce message templates.
 .na
 .nf
 bounce(5), bounce template file format
-postconf(5), configuration parameters
+master(5), master.cf configuration file syntax
+postconf(5), main.cf configuration file syntax
 .SH "README FILES"
 .na
 .nf
index 9bb63f34641ce942e32dd7a01aa28afccffa163b..0953cce38924c1f3e6eb3f672c46f55419b58e42 100644 (file)
@@ -170,7 +170,7 @@ $data_directory/master.lock, master lock file.
 qmgr(8), queue manager
 verify(8), address verification
 master(5), master.cf configuration file syntax
-postconf(5), main.cf configuration parameter syntax
+postconf(5), main.cf configuration file syntax
 syslogd(8), system logging
 .SH "LICENSE"
 .na
index e0be76baac8390fed1e408b1047d8620665f44bc..47907172b5584d4e22ad31240f2df0e1aacd8dc1 100644 (file)
@@ -20,7 +20,7 @@
   * Patches change both the patchlevel and the release date. Snapshots have no
   * patchlevel; they change the release date only.
   */
-#define MAIL_RELEASE_DATE      "20111113"
+#define MAIL_RELEASE_DATE      "20111117"
 #define MAIL_VERSION_NUMBER    "2.9"
 
 #ifdef SNAPSHOT
index cc41e57d90c0a868ece56e57ebeaa8254fa6b1a6..cef01e4017b830de3926306814c18db89af018f3 100644 (file)
 /*     qmgr(8), queue manager
 /*     verify(8), address verification
 /*     master(5), master.cf configuration file syntax
-/*     postconf(5), main.cf configuration parameter syntax
+/*     postconf(5), main.cf configuration file syntax
 /*     syslogd(8), system logging
 /* LICENSE
 /* .ad
index 64b4b823ed2a0c0df45fb76e6143a32836cc3ba2..eec7626a81823c4e7b826b5d74c0ac46ef075824 100644 (file)
@@ -36,7 +36,7 @@ Makefile: Makefile.in
 
 test:  $(TESTPROG)
 
-tests: test1 test2 test3 test4 test5
+tests: test1 test2 test3 test4 test5 test6 test7 test8
 
 root_tests:
 
@@ -79,7 +79,6 @@ test2:        $(PROG) test2.ref
 test3: $(PROG) test3.ref
        rm -f main.cf master.cf
        touch main.cf master.cf
-       ./$(PROG) -nc . >test_base.tmp 2>&1
        echo foo = yes >> main.cf
        echo 'bar = $$foo' >> main.cf
        echo 'always_bcc = $$bar' >> main.cf
@@ -92,10 +91,9 @@ test3:       $(PROG) test3.ref
 test4: $(PROG) test4.ref
        rm -f main.cf master.cf
        touch main.cf master.cf
-       ./$(PROG) -nc . >test_base.tmp 2>&1
        echo foo = yes >> main.cf
        echo 'bar = $$foo' >> main.cf
-       echo smtpd 1 2 3 4 5 6 7 >> master.cf
+       echo smtpd unix - n n - 0 smtpd >> master.cf
        echo ' -o always_bcc=$$bar' >> master.cf
        ./$(PROG) -nc . >test4.tmp 2>&1
        diff test4.ref test4.tmp
@@ -109,13 +107,41 @@ test4:    $(PROG) test4.ref
 test5: $(PROG) test5.ref
        rm -f main.cf master.cf
        touch main.cf master.cf
-       ./$(PROG) -nc . >test_base.tmp 2>&1
-       echo smtpd 1 2 3 4 5 6 7 >> master.cf
+       echo smtpd unix - n n - 0 smtpd >> master.cf
        echo ' -o bar=yes -o always_bcc=$$bar -o' >> master.cf
        ./$(PROG) -nc . >test5.tmp 2>&1
        diff test5.ref test5.tmp
        rm -f main.cf master.cf test5.tmp
 
+# Basic functionality test: service parameters for delivery agents.
+
+test6: $(PROG) test6.ref
+       rm -f main.cf master.cf
+       touch main.cf master.cf
+       echo whatevershebrings unix - n n - 0 pipe >> master.cf
+       ./$(PROG) -c . 2>&1 | grep whatevershebrings >test6.tmp
+       diff test6.ref test6.tmp
+       rm -f main.cf master.cf test6.tmp
+
+# Basic functionality test: service parameters for spawn programs.
+
+test7: $(PROG) test7.ref
+       rm -f main.cf master.cf
+       touch main.cf master.cf
+       echo whatevershebrings unix - n n - 0 spawn >> master.cf
+       ./$(PROG) -c . 2>&1 | grep whatevershebrings >test7.tmp
+       diff test7.ref test7.tmp
+       rm -f main.cf master.cf test7.tmp
+
+test8: $(PROG) test8.ref
+       rm -f main.cf master.cf
+       touch main.cf master.cf
+       echo whatevershebrings inet - n n - 0 spawn >> master.cf
+       echo whatevershebrings_time_limit=1 >> main.cf
+       ./$(PROG) -c . 2>&1 | grep whatevershebrings >test8.tmp
+       diff test8.ref test8.tmp
+       rm -f main.cf master.cf test8.tmp
+
 printfck: $(OBJS) $(PROG)
        rm -rf printfck
        mkdir printfck
@@ -152,6 +178,8 @@ postconf.o: ../../include/get_hostname.h
 postconf.o: ../../include/htable.h
 postconf.o: ../../include/inet_proto.h
 postconf.o: ../../include/iostuff.h
+postconf.o: ../../include/mac_expand.h
+postconf.o: ../../include/mac_parse.h
 postconf.o: ../../include/mail_addr.h
 postconf.o: ../../include/mail_conf.h
 postconf.o: ../../include/mail_dict.h
index e22f63e4f55d3f519e14b8d114fbea39eb4bffb4..cbc079be12c1a7dc5c4a48ac2d03f465940421c3 100644 (file)
 /* DIAGNOSTICS
 /*     Problems are reported to the standard error stream.
 /* BUGS
-/*     There currently is no support for per-service parameter
-/*     name spaces in master.cf.  This means that "-o
-/*     user-defined-name=value" always results in an "unused
-/*     parameter" warning.
+/*     \fBpostconf\fR(1) may log "unused parameter" warnings for
+/*     \fBmaster.cf\fR entries with "-o user-defined-name=value".
+/*     Addressing this limitation requires support for per-service
+/*     parameter name spaces.
 /* ENVIRONMENT
 /* .ad
 /* .fi
 /*     /etc/postfix/main.cf, Postfix configuration parameters
 /* SEE ALSO
 /*     bounce(5), bounce template file format
-/*     postconf(5), configuration parameters
+/*     master(5), master.cf configuration file syntax
+/*     postconf(5), main.cf configuration file syntax
 /* README FILES
 /* .ad
 /* .fi
@@ -349,7 +350,7 @@ HTABLE *param_table;
   * Lookup table for master.cf info.
   * 
   * XXX Replace by data structures with per-entry hashes for "-o name=value", so
-  * that we can properly handle of definitions and uses in per-service name
+  * that we can properly handle name=value definitions in per-service name
   * spaces.
   */
 static ARGV **master_table;
@@ -423,14 +424,14 @@ static const CONFIG_LONG_TABLE long_table[] = {
 typedef struct {
     const char *name;
     const char *value;
-} STRING_NV;
+} PC_STRING_NV;
 
  /*
   * Service-defined parameter names are created by appending postfix-defined
   * suffixes to master.cf service names. These parameters have default values
   * that are defined by built-in parameters.
   */
-static STRING_NV *serv_param_table;
+static PC_STRING_NV *serv_param_table;
 static ssize_t serv_param_tablen;
 
  /*
@@ -767,8 +768,13 @@ static void set_parameters(void)
 {
 
     /*
-     * Populate the configuration parameter dictionary with default settings
-     * or with actual settings.
+     * The proposal below describes some of the steps needed to expand
+     * parameter values. It has a problem: it updates the configuration
+     * parameter dictionary, and in doing so breaks the "postconf -d"
+     * implementation.
+     * 
+     * Populate the configuration parameter dictionary with default settings or
+     * with actual settings.
      * 
      * Iterate over each entry in str_fn_table, str_fn_table_2, time_table,
      * bool_table, int_table, str_table, and raw_table. Look up each
@@ -856,7 +862,7 @@ static void read_master(void)
 static void add_service_parameter(const char *service, const char *suffix,
                                          const char *defparam)
 {
-    STRING_NV *sp;
+    PC_STRING_NV *sp;
     char   *name = concatenate(service, suffix, (char *) 0);
 
     /*
@@ -867,11 +873,11 @@ static void add_service_parameter(const char *service, const char *suffix,
     if (htable_locate(param_table, name) != 0) {
        myfree(name);
     } else {
-       serv_param_table = (STRING_NV *)
+       serv_param_table = (PC_STRING_NV *)
            myrealloc((char *) serv_param_table,
                      (serv_param_tablen + 1) * sizeof(*serv_param_table));
        sp = serv_param_table + serv_param_tablen;
-       sp->name = concatenate(service, suffix, (char *) 0);
+       sp->name = name;
        sp->value = defparam;
        serv_param_tablen += 1;
     }
@@ -881,14 +887,7 @@ static void add_service_parameter(const char *service, const char *suffix,
 
 static void add_service_parameters(void)
 {
-    /* XXX Should this list be configurable? */
-    static const char *delivery_agents[] = {
-       MAIL_PROGRAM_LOCAL, MAIL_PROGRAM_ERROR,
-       MAIL_PROGRAM_VIRTUAL, MAIL_PROGRAM_SMTP,
-       MAIL_PROGRAM_LMTP, MAIL_PROGRAM_PIPE,
-       0,
-    };
-    static const STRING_NV service_params[] = {
+    static const PC_STRING_NV service_params[] = {
        /* suffix, default parameter name */
        _XPORT_RCPT_LIMIT, VAR_XPORT_RCPT_LIMIT,
        _STACK_RCPT_LIMIT, VAR_STACK_RCPT_LIMIT,
@@ -907,22 +906,36 @@ static void add_service_parameters(void)
        _DEST_RATE_DELAY, VAR_DEST_RATE_DELAY,
        0,
     };
-    static const STRING_NV spawn_params[] = {
+    static const PC_STRING_NV spawn_params[] = {
        /* suffix, default parameter name */
        _MAXTIME, VAR_COMMAND_MAXTIME,
        0,
     };
-    const STRING_NV *sp;
+    typedef struct {
+       const char *progname;
+       const PC_STRING_NV *params;
+    } PC_SERVICE_DEF;
+    static const PC_SERVICE_DEF service_defs[] = {
+       MAIL_PROGRAM_LOCAL, service_params,
+       MAIL_PROGRAM_ERROR, service_params,
+       MAIL_PROGRAM_VIRTUAL, service_params,
+       MAIL_PROGRAM_SMTP, service_params,
+       MAIL_PROGRAM_LMTP, service_params,
+       MAIL_PROGRAM_PIPE, service_params,
+       MAIL_PROGRAM_SPAWN, spawn_params,
+       0,
+    };
+    const PC_STRING_NV *sp;
     const char *progname;
     const char *service;
     ARGV  **argvp;
     ARGV   *argv;
-    const char **cpp;
+    const PC_SERVICE_DEF *sd;
 
     /*
      * Initialize the table with service parameter names and defaults.
      */
-    serv_param_table = (STRING_NV *) mymalloc(1);
+    serv_param_table = (PC_STRING_NV *) mymalloc(1);
     serv_param_tablen = 0;
 
     /*
@@ -932,33 +945,17 @@ static void add_service_parameters(void)
     for (argvp = master_table; (argv = *argvp) != 0; argvp++) {
 
        /*
-        * Skip all endpoints except UNIX-domain sockets.
-        */
-       if (strcmp(argv->argv[1], MASTER_XPORT_NAME_UNIX) != 0)
-           continue;
-
-       /*
-        * Add service parameters for message delivery transports.
+        * Add service parameters for message delivery transports or spawn
+        * programs.
         */
        progname = argv->argv[7];
-       for (cpp = delivery_agents; *cpp; cpp++)
-           if (strcmp(*cpp, progname) == 0)
+       for (sd = service_defs; sd->progname; sd++) {
+           if (strcmp(sd->progname, progname) == 0) {
+               service = argv->argv[0];
+               for (sp = sd->params; sp->name; sp++)
+                   add_service_parameter(service, sp->name, sp->value);
                break;
-       if (*cpp != 0) {
-           service = argv->argv[0];
-           for (sp = service_params; sp->name; sp++)
-               add_service_parameter(service, sp->name, sp->value);
-           continue;
-       }
-
-       /*
-        * Add service parameters for spawn(8)-based services.
-        */
-       if (strcmp(MAIL_PROGRAM_SPAWN, progname) == 0) {
-           service = argv->argv[0];
-           for (sp = spawn_params; sp->name; sp++)
-               add_service_parameter(service, sp->name, sp->value);
-           continue;
+           }
        }
     }
 
@@ -1056,9 +1053,9 @@ static void add_user_parameters(void)
      * but only if they have a "name=value" entry in main.cf.
      * 
      * XXX It is possible that a user-defined parameter is defined in master.cf
-     * with "-o smtpd_restriction_classes=name -o name=value". To handle this
-     * we need to give each master.cf entry its own name space. Until then,
-     * we may log false warnings for unused "-o name=value" entries.
+     * with "-o smtpd_restriction_classes=name -o name=value". This requires
+     * name space support for master.cf entries. Without this, we always log
+     * "unused parameter" warnings for "-o user-defined-name=value" entries.
      */
     if ((class_list = mail_conf_lookup_eval(VAR_REST_CLASSES)) != 0) {
        cp = saved_class_list = mystrdup(class_list);
@@ -1070,8 +1067,9 @@ static void add_user_parameters(void)
     /*
      * Parse the "name=value" instances in main.cf of built-in and service
      * parameters only, look for macro expansions of unknown parameter names,
-     * and flag those unknown parameter names as "known" if they have a
-     * "name=value" entry in main.cf.
+     * and flag those parameter names as "known" if they have a "name=value"
+     * entry in main.cf. Recursively apply the procedure to the values of
+     * newly-flagged parameters.
      */
     for (ht_info = ht = htable_list(param_table); *ht; ht++)
        if ((cparam_value = mail_conf_lookup(ht[0]->key)) != 0)
@@ -1079,16 +1077,11 @@ static void add_user_parameters(void)
     myfree((char *) ht_info);
 
     /*
-     * Parse all "-o parameter=value" instances in master.cf, look for for
-     * macro expansions of unknown parameter names, and flag those unknown
-     * parameter names as "known" if they have a "name=value" entry in
-     * main.cf.
-     * 
-     * XXX It is possible that a user-defined parameter is defined in master.cf
-     * with "-o name1=value1" and then used in a "-o name2=$name1" macro
-     * expansion in that same master.cf entry. To handle this we need to give
-     * each master.cf entry its own name space. Until then, we may log false
-     * warnings for unused "-o name=value" entries.
+     * Parse all "-o parameter=value" instances in master.cf, look for macro
+     * expansions of unknown parameter names, and flag those parameter names
+     * as "known" if they have a "name=value" entry in main.cf (XXX todo: in
+     * master.cf; without master.cf name space support we always log "unused
+     * parameter" warnings for "-o user-defined-name=value" entries).
      */
     for (argvp = master_table; (argv = *argvp) != 0; argvp++) {
        for (field = MASTER_FIELD_COUNT; argv->argv[field] != 0; field++) {
@@ -1505,7 +1498,7 @@ static void print_service_param_default(int mode, const char *name,
 /* print_service_param - show service parameter */
 
 static void print_service_param(int mode, const char *name,
-                                       const STRING_NV *dst)
+                                       const PC_STRING_NV *dst)
 {
     const char *value;
 
@@ -1581,7 +1574,7 @@ static void print_parameter(int mode, const char *name, char *ptr)
     if (INSIDE(ptr, long_table))
        print_long(mode, name, (CONFIG_LONG_TABLE *) ptr);
     if (INSIDE3(ptr, serv_param_table, serv_param_tablen))
-       print_service_param(mode, name, (STRING_NV *) ptr);
+       print_service_param(mode, name, (PC_STRING_NV *) ptr);
     if (INSIDE3(ptr, user_param_table, user_param_tablen))
        print_user_param(mode, name);
     if (msg_verbose)
@@ -1824,8 +1817,8 @@ static void flag_unused_master_parameters(void)
      * with "-o smtpd_restriction_classes=name", or with "-o name1=value1"
      * and then used in a "-o name2=$name1" macro expansion in that same
      * master.cf entry. To handle this we need to give each master.cf entry
-     * its own name space. Until then, we may log false warnings for unused
-     * "-o name=value" entries.
+     * its own name space. Until then, we always log "unused parameter"
+     * warnings for "-o user-defined-name=value" entries.
      */
     for (argvp = master_table; (argv = *argvp) != 0; argvp++) {
        for (field = MASTER_FIELD_COUNT; argv->argv[field] != 0; field++) {
diff --git a/postfix/src/postconf/test6.ref b/postfix/src/postconf/test6.ref
new file mode 100644 (file)
index 0000000..bb1c81e
--- /dev/null
@@ -0,0 +1,15 @@
+whatevershebrings_delivery_slot_cost = $default_delivery_slot_cost
+whatevershebrings_delivery_slot_discount = $default_delivery_slot_discount
+whatevershebrings_delivery_slot_loan = $default_delivery_slot_loan
+whatevershebrings_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit
+whatevershebrings_destination_concurrency_limit = $default_destination_concurrency_limit
+whatevershebrings_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback
+whatevershebrings_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback
+whatevershebrings_destination_rate_delay = $default_destination_rate_delay
+whatevershebrings_destination_recipient_limit = $default_destination_recipient_limit
+whatevershebrings_extra_recipient_limit = $default_extra_recipient_limit
+whatevershebrings_initial_destination_concurrency = $initial_destination_concurrency
+whatevershebrings_minimum_delivery_slots = $default_minimum_delivery_slots
+whatevershebrings_recipient_limit = $default_recipient_limit
+whatevershebrings_recipient_refill_delay = $default_recipient_refill_delay
+whatevershebrings_recipient_refill_limit = $default_recipient_refill_limit
diff --git a/postfix/src/postconf/test7.ref b/postfix/src/postconf/test7.ref
new file mode 100644 (file)
index 0000000..1bd731b
--- /dev/null
@@ -0,0 +1 @@
+whatevershebrings_time_limit = $command_time_limit
diff --git a/postfix/src/postconf/test8.ref b/postfix/src/postconf/test8.ref
new file mode 100644 (file)
index 0000000..af47b44
--- /dev/null
@@ -0,0 +1 @@
+whatevershebrings_time_limit = 1
index bcdbefdc080242fb273250237ea5bac5b56004b9..46eae5c5df80d8e93dcc2f9b973562eaf1767696 100644 (file)
@@ -335,6 +335,15 @@ typedef struct SINK_STATE {
 #define SOFT_ERROR_RESP                "450 4.3.0 Error: command failed"
 #define HARD_ERROR_RESP                "500 5.3.0 Error: command failed"
 
+ /*
+  * We can't rely on vstream auto-flushing, so we have to prepare for the
+  * next read request.
+  */
+#define SMTP_FLUSH(fp) do { \
+    if (vstream_peek(fp) <= 0 && readable(vstream_fileno(fp)) <= 0) \
+        smtp_flush(fp); \
+    } while (0)
+
 static int var_tmout = 100;
 static int var_max_line_length = 2048;
 static char *var_myhostname;
@@ -387,7 +396,7 @@ static void do_stats(void)
 static void hard_err_resp(SINK_STATE *state)
 {
     smtp_printf(state->stream, "%s", hard_error_resp);
-    smtp_flush(state->stream);
+    SMTP_FLUSH(state->stream);
 }
 
 /* soft_err_resp - generic soft error response */
@@ -395,7 +404,7 @@ static void hard_err_resp(SINK_STATE *state)
 static void soft_err_resp(SINK_STATE *state)
 {
     smtp_printf(state->stream, "%s", soft_error_resp);
-    smtp_flush(state->stream);
+    SMTP_FLUSH(state->stream);
 }
 
 /* exp_path_template - expand template pathname, static result */
@@ -618,7 +627,7 @@ static void ehlo_response(SINK_STATE *state, const char *args)
        smtp_printf(state->stream, "250-ENHANCEDSTATUSCODES");
     /* RFC 821/2821/5321: Format is replycode<SPACE>optional-text<CRLF> */
     smtp_printf(state->stream, "250 ");
-    smtp_flush(state->stream);
+    SMTP_FLUSH(state->stream);
     if (single_template) {
        if (state->helo_args)
            myfree(state->helo_args);
@@ -635,7 +644,7 @@ static void helo_response(SINK_STATE *state, const char *args)
     mail_cmd_reset(state);
     state->client_proto = "SMTP";
     smtp_printf(state->stream, "250 %s", var_myhostname);
-    smtp_flush(state->stream);
+    SMTP_FLUSH(state->stream);
     if (single_template) {
        if (state->helo_args)
            myfree(state->helo_args);
@@ -649,7 +658,7 @@ static void helo_response(SINK_STATE *state, const char *args)
 static void ok_response(SINK_STATE *state, const char *unused_args)
 {
     smtp_printf(state->stream, "250 2.0.0 Ok");
-    smtp_flush(state->stream);
+    SMTP_FLUSH(state->stream);
 }
 
 /* rset_response - reset, send 250 OK */
@@ -658,7 +667,7 @@ static void rset_response(SINK_STATE *state, const char *unused_args)
 {
     mail_cmd_reset(state);
     smtp_printf(state->stream, "250 2.1.0 Ok");
-    smtp_flush(state->stream);
+    SMTP_FLUSH(state->stream);
 }
 
 /* mail_response - reset recipient count, send 250 OK */
@@ -667,13 +676,13 @@ static void mail_response(SINK_STATE *state, const char *args)
 {
     if (state->in_mail) {
        smtp_printf(state->stream, "503 5.5.1 Error: nested MAIL command");
-       smtp_flush(state->stream);
+       SMTP_FLUSH(state->stream);
        return;
     }
     state->in_mail++;
     state->rcpts = 0;
     smtp_printf(state->stream, "250 2.1.0 Ok");
-    smtp_flush(state->stream);
+    SMTP_FLUSH(state->stream);
     if (single_template) {
        mail_file_open(state);
        SKIP(args, *args != ':');
@@ -689,12 +698,12 @@ static void rcpt_response(SINK_STATE *state, const char *args)
 {
     if (state->in_mail == 0) {
        smtp_printf(state->stream, "503 5.5.1 Error: need MAIL command");
-       smtp_flush(state->stream);
+       SMTP_FLUSH(state->stream);
        return;
     }
     state->rcpts++;
     smtp_printf(state->stream, "250 2.1.5 Ok");
-    smtp_flush(state->stream);
+    SMTP_FLUSH(state->stream);
     /* Note: there may be more than one recipient per mail transaction. */
     if (state->dump_file) {
        SKIP(args, *args != ':');
@@ -711,7 +720,7 @@ static void abort_event(int unused_event, char *context)
     SINK_STATE *state = (SINK_STATE *) context;
 
     smtp_printf(state->stream, "550 This violates SMTP");
-    smtp_flush(state->stream);
+    SMTP_FLUSH(state->stream);
     disconnect(state);
 }
 
@@ -721,13 +730,13 @@ static void data_response(SINK_STATE *state, const char *unused_args)
 {
     if (state->in_mail == 0 || state->rcpts == 0) {
        smtp_printf(state->stream, "503 5.5.1 Error: need RCPT command");
-       smtp_flush(state->stream);
+       SMTP_FLUSH(state->stream);
        return;
     }
     /* Not: ST_ANY. */
     state->data_state = ST_CR_LF;
     smtp_printf(state->stream, "354 End data with <CR><LF>.<CR><LF>");
-    smtp_flush(state->stream);
+    SMTP_FLUSH(state->stream);
     if (abort_delay < 0) {
        state->read_fn = data_read;
     } else {
@@ -750,7 +759,7 @@ static void dot_resp_hard(SINK_STATE *state)
     } else {
        smtp_printf(state->stream, "%s", hard_error_resp);
     }
-    smtp_flush(state->stream);
+    SMTP_FLUSH(state->stream);
 }
 
 /* dot_resp_soft - soft error response to . command */
@@ -763,7 +772,7 @@ static void dot_resp_soft(SINK_STATE *state)
     } else {
        smtp_printf(state->stream, "%s", soft_error_resp);
     }
-    smtp_flush(state->stream);
+    SMTP_FLUSH(state->stream);
 }
 
 /* dot_response - response to . command */
@@ -776,7 +785,7 @@ static void dot_response(SINK_STATE *state, const char *unused_args)
     } else {
        smtp_printf(state->stream, "250 2.0.0 Ok");
     }
-    smtp_flush(state->stream);
+    SMTP_FLUSH(state->stream);
 }
 
 /* quit_response - respond to QUIT command */
@@ -784,7 +793,7 @@ static void dot_response(SINK_STATE *state, const char *unused_args)
 static void quit_response(SINK_STATE *state, const char *unused_args)
 {
     smtp_printf(state->stream, "221 Bye");
-    smtp_flush(state->stream);
+    smtp_flush(state->stream);                 /* not: SMTP_FLUSH */
     if (count)
        quit_count++;
 }
@@ -799,7 +808,7 @@ static void conn_response(SINK_STATE *state, const char *unused_args)
        smtp_printf(state->stream, "220 %s", var_myhostname);
     else
        smtp_printf(state->stream, "220 %s ESMTP", var_myhostname);
-    smtp_flush(state->stream);
+    SMTP_FLUSH(state->stream);
 }
 
 /* delay_event - delayed command response */
@@ -1175,7 +1184,7 @@ static int command_read(SINK_STATE *state)
        msg_info("%s", ptr);
     if ((command = mystrtok(&ptr, " \t")) == 0) {
        smtp_printf(state->stream, "500 5.5.2 Error: unknown command");
-       smtp_flush(state->stream);
+       SMTP_FLUSH(state->stream);
        return (0);
     }
     for (cmdp = command_table; cmdp->name != 0; cmdp++)
@@ -1183,7 +1192,7 @@ static int command_read(SINK_STATE *state)
            break;
     if (cmdp->name == 0 || (cmdp->flags & FLAG_ENABLE) == 0) {
        smtp_printf(state->stream, "500 5.5.1 Error: unknown command");
-       smtp_flush(state->stream);
+       SMTP_FLUSH(state->stream);
        return (0);
     }
     return (command_resp(state, cmdp, command, printable(ptr, '?')));
index c0ad50675dbebb422c5f8ae275e8b75a44e4cbf8..fd082ed07fb64d936c0bcb2345c8a970c511f4b6 100644 (file)
@@ -219,7 +219,7 @@ INET_PROTO_INFO *inet_proto_init(const char *context, const char *protocols)
            pf->dns_atype_list = make_unsigned_vector(3, T_A, T_AAAA, 0);
            pf->sa_family_list = make_uchar_vector(3, AF_INET, AF_INET6, 0);
            break;
-       } else if (errno == EAFNOSUPPORT) {
+       } else if (errno == EAFNOSUPPORT || errno == EPROTONOSUPPORT) {
            msg_warn("%s: IPv6 support is disabled: %m", context);
            msg_warn("%s: configuring for IPv4 support only", context);
            /* FALLTHROUGH */
index be7f82249cc537e38253912199fffa5b9ff98084..6c75dc9c165ac9e05aeb324c11c10e4dee849ca8 100644 (file)
@@ -371,11 +371,6 @@ XSASL_SERVER_IMPL *xsasl_dovecot_server_init(const char *server_type,
 {
     XSASL_DOVECOT_SERVER_IMPL *xp;
 
-    if (strchr(path_info, '/') == 0)
-       msg_warn("when SASL type is \"%s\", SASL path \"%s\" "
-                "should be a socket pathname",
-                server_type, path_info);
-
     xp = (XSASL_DOVECOT_SERVER_IMPL *) mymalloc(sizeof(*xp));
     xp->xsasl.create = xsasl_dovecot_server_create;
     xp->xsasl.done = xsasl_dovecot_server_done;