]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
snapshot-20010801
authorWietse Venema <wietse@porcupine.org>
Wed, 1 Aug 2001 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:27:25 +0000 (06:27 +0000)
17 files changed:
postfix/FILTER_README
postfix/HISTORY
postfix/RELEASE_NOTES
postfix/conf/main.cf
postfix/conf/sample-smtpd.cf
postfix/src/cleanup/cleanup.c
postfix/src/global/mail_version.h
postfix/src/master/multi_server.c
postfix/src/master/single_server.c
postfix/src/master/trigger_server.c
postfix/src/nqmgr/qmgr.c
postfix/src/nqmgr/qmgr.h
postfix/src/nqmgr/qmgr_active.c
postfix/src/postconf/postconf.c
postfix/src/qmgr/qmgr.c
postfix/src/qmgr/qmgr.h
postfix/src/qmgr/qmgr_active.c

index 07557a7a595f15b397b583bf5bfe589c8bb5975c..99bf9b0501275b5d95ce85ef249b3fd48454d049 100644 (file)
@@ -57,7 +57,7 @@ The /some/where/filter program can be a simple shell script like this:
 
     # Localize these
     INSPECT_DIR=/var/spool/filter
-    SENDMAIL=/usr/sbin/sendmail
+    SENDMAIL="/usr/sbin/sendmail -i"
 
     # Exit codes from <sysexits.h>
     EX_TEMPFAIL=75
index 0a42ce0b6c16b75af2cbf43e0092ca8b13825186..e3d94f5d468d67890345a7da8620e00048442df6 100644 (file)
@@ -5398,3 +5398,10 @@ Apologies for any names omitted.
        Postfix send one RFC-standard, non-VERP, bounce report for
        multi-recipient mail, even when VERP style delivery is
        requested.
+
+20010801
+
+       Bugfix: postconf was using unexpanded values internally
+       for myhostname, inet_interfaces, and mynetworks_style.
+       This broke the default mynetworks setting calculation.
+       File: postconf/postconf.c.
index 721d02f595840f5ff9555c086bb4d46423a74138..026c4140f85acd337987a57aacaa0afa2eb719b8 100644 (file)
@@ -1,11 +1,11 @@
-Incompatible changes with snapshot-20010731
+Incompatible changes with snapshot-20010801
 ===========================================
 
 The protocol between Postfix master and child processes has changed.
 You must stop and start Postfix in order to switch between Snapshot
-20010731 and releases that implement the older protocol.
+20010801 and releases that implement the older protocol.
 
-Major changes with snapshot-20010731
+Major changes with snapshot-20010801
 ====================================
 
 Specify "disable_verp_bounces = yes" to have Postfix send one
index 5e6b2c4c8888a0e19f8b8a73f6c44085bd9ad47a..9bd6bcd61a67213f004be66edb0a5f13265a808b 100644 (file)
@@ -164,11 +164,12 @@ mail_owner = postfix
 # address.
 #
 # You can also specify the absolute pathname of a pattern file instead
-# of listing the patterns here. Specify type:name for table-based lookups
+# of listing the patterns here. Specify type:table for table-based lookups
 # (the value on the table right-hand side is not used).
 #
 #mynetworks = 168.100.189.0/28, 127.0.0.0/8
 #mynetworks = $config_directory/mynetworks
+#mynetworks = hash:/etc/postfix/network_table
 
 # The relay_domains parameter restricts what clients this mail system
 # will relay mail from, or what destinations this system will relay
index 1429a5e742334f64f98c442555191a8f2b6e0cf9..082cb760cd97793985cf48c67e5b7662c25ef464 100644 (file)
@@ -135,11 +135,12 @@ mynetworks_style = subnet
 # address.
 #
 # You can also specify the absolute pathname of a pattern file instead
-# of listing the patterns here. Specify type:name for table-based lookups
+# of listing the patterns here. Specify type:table for table-based lookups
 # (the value on the table right-hand side is not used).
 #
 #mynetworks = 168.100.189.0/28, 127.0.0.0/8
 #mynetworks = $config_directory/mynetworks
+#mynetworks = hash:/etc/postfix/network_table
 
 # The smtpd_client_restrictions parameter specifies optional restrictions
 # on SMTP client host names and addresses.
index 7e7b369ad9a2ea283caf39eac15891783fe96c86..3026f974030f18237f002c19ee1c81cfebfc7678 100644 (file)
@@ -274,6 +274,6 @@ int     main(int argc, char **argv)
                       MAIL_SERVER_PRE_INIT, cleanup_pre_jail,
                       MAIL_SERVER_POST_INIT, cleanup_post_jail,
                       MAIL_SERVER_PRE_ACCEPT, pre_accept,
-                      MAIL_SERVER_IN_FLOW_DELAY, var_in_flow_delay,
+                      MAIL_SERVER_IN_FLOW_DELAY,
                       0);
 }
index 234a54fe4de194ea999d0811f1305ed98484c2bd..2e2aa1b6cb7f1422d0f00d349796a2a73e6bf9e5 100644 (file)
@@ -15,7 +15,7 @@
   * Version of this program.
   */
 #define VAR_MAIL_VERSION       "mail_version"
-#define DEF_MAIL_VERSION       "Snapshot-20010731"
+#define DEF_MAIL_VERSION       "Snapshot-20010801"
 extern char *var_mail_version;
 
 /* LICENSE
index 746e7c03310f70da3dd5c4eb47b633fc03b9810d..0be6a633586a47660ab626f5e507c96d1755e623 100644 (file)
@@ -95,8 +95,8 @@
 /*     Function to be executed prior to accepting a new connection.
 /* .sp
 /*     Only the last instance of this parameter type is remembered.
-/* .IP "MAIL_SERVER_IN_FLOW_DELAY (int)"
-/*     The amount of seconds to pause when no "mail flow control token"
+/* .IP "MAIL_SERVER_IN_FLOW_DELAY (none)"
+/*     Pause $in_flow_delay seconds when no "mail flow control token"
 /*     is available. A token is consumed for each connection request.
 /* .PP
 /*     multi_server_disconnect() should be called by the application
@@ -280,9 +280,9 @@ static void multi_server_wakeup(int fd)
     client_count++;
     stream = vstream_fdopen(fd, O_RDWR);
     timed_ipc_setup(stream);
-    if (multi_server_in_flow_delay > 0 && mail_flow_get(1) < 0)
+    if (multi_server_in_flow_delay && mail_flow_get(1) < 0)
        event_request_timer(multi_server_enable_read, (char *) stream,
-                           multi_server_in_flow_delay);
+                           var_in_flow_delay);
     else
        multi_server_enable_read(0, (char *) stream);
 }
@@ -517,7 +517,7 @@ NORETURN multi_server_main(int argc, char **argv, MULTI_SERVER_FN service,...)
            multi_server_pre_accept = va_arg(ap, MAIL_SERVER_ACCEPT_FN);
            break;
        case MAIL_SERVER_IN_FLOW_DELAY:
-           multi_server_in_flow_delay = va_arg(ap, int);
+           multi_server_in_flow_delay = 1;
            break;
        default:
            msg_panic("%s: unknown argument type: %d", myname, key);
index 5860fc79823dd046cfc51d241dd4597f10a069cb..21079f8e9b2b3f6c6ba064290ff738cd9170f812 100644 (file)
@@ -92,8 +92,8 @@
 /*     Function to be executed prior to accepting a new connection.
 /* .sp
 /*     Only the last instance of this parameter type is remembered.
-/* .IP "MAIL_SERVER_IN_FLOW_DELAY (int)"
-/*     The amount of seconds to pause when no "mail flow control token"
+/* .IP "MAIL_SERVER_IN_FLOW_DELAY (none)"
+/*     Pause $in_flow_delay seconds when no "mail flow control token"
 /*     is available. A token is consumed for each connection request.
 /* .PP
 /*     The var_use_limit variable limits the number of clients that
@@ -236,8 +236,8 @@ static void single_server_wakeup(int fd)
     timed_ipc_setup(stream);
     if (master_notify(var_pid, MASTER_STAT_TAKEN) < 0)
        single_server_abort(EVENT_NULL_TYPE, EVENT_NULL_CONTEXT);
-    if (single_server_in_flow_delay > 0 && mail_flow_get(1) < 0)
-       doze(single_server_in_flow_delay * 1000000);
+    if (single_server_in_flow_delay && mail_flow_get(1) < 0)
+       doze(var_in_flow_delay * 1000000);
     single_server_service(stream, single_server_name, single_server_argv);
     (void) vstream_fclose(stream);
     if (master_notify(var_pid, MASTER_STAT_AVAIL) < 0)
@@ -477,7 +477,7 @@ NORETURN single_server_main(int argc, char **argv, SINGLE_SERVER_FN service,...)
            single_server_pre_accept = va_arg(ap, MAIL_SERVER_ACCEPT_FN);
            break;
        case MAIL_SERVER_IN_FLOW_DELAY:
-           single_server_in_flow_delay = va_arg(ap, int);
+           single_server_in_flow_delay = 1;
            break;
        default:
            msg_panic("%s: unknown argument type: %d", myname, key);
index 62ce674aa2ff1dda5247eaf391b19e73bf3c2b2e..c84b8a8b5197000e09a3cfdbdbac60253759f718 100644 (file)
@@ -99,8 +99,8 @@
 /*     Function to be executed prior to accepting a new request.
 /* .sp
 /*     Only the last instance of this parameter type is remembered.
-/* .IP "MAIL_SERVER_IN_FLOW_DELAY (int)"
-/*     The amount of seconds to pause when no "mail flow control token"
+/* .IP "MAIL_SERVER_IN_FLOW_DELAY (none)"
+/*     Pause $in_flow_delay seconds when no "mail flow control token"
 /*     is available. A token is consumed for each connection request.
 /* .PP
 /*     The var_use_limit variable limits the number of clients that
@@ -235,8 +235,8 @@ static void trigger_server_wakeup(int fd)
      */
     if (master_notify(var_pid, MASTER_STAT_TAKEN) < 0)
        trigger_server_abort(EVENT_NULL_TYPE, EVENT_NULL_CONTEXT);
-    if (trigger_server_in_flow_delay > 0 && mail_flow_get(1) < 0)
-       doze(trigger_server_in_flow_delay * 1000000);
+    if (trigger_server_in_flow_delay && mail_flow_get(1) < 0)
+       doze(var_in_flow_delay * 1000000);
     if ((len = read(fd, buf, sizeof(buf))) >= 0)
        trigger_server_service(buf, len, trigger_server_name,
                               trigger_server_argv);
@@ -477,7 +477,7 @@ NORETURN trigger_server_main(int argc, char **argv, TRIGGER_SERVER_FN service,..
            trigger_server_pre_accept = va_arg(ap, MAIL_SERVER_ACCEPT_FN);
            break;
        case MAIL_SERVER_IN_FLOW_DELAY:
-           trigger_server_in_flow_delay = va_arg(ap, int);
+           trigger_server_in_flow_delay = 1;
            break;
        default:
            msg_panic("%s: unknown argument type: %d", myname, key);
index 438691b50752538d544f37922d836d0202e0f9f6..e259e47aa061c78bebc094eb2856b94ec3e8db11 100644 (file)
@@ -423,6 +423,7 @@ static int qmgr_loop(char *unused_name, char **unused_argv)
     char   *in_path = 0;
     char   *df_path = 0;
     int     token_count;
+    int     in_feed = 0;
 
     /*
      * This routine runs as part of the event handling loop, after the event
@@ -448,7 +449,7 @@ static int qmgr_loop(char *unused_name, char **unused_argv)
      */
     if (qmgr_message_count < var_qmgr_active_limit)
        if ((in_path = qmgr_scan_next(qmgr_incoming)) != 0)
-           qmgr_active_feed(qmgr_incoming, in_path);
+           in_feed = qmgr_active_feed(qmgr_incoming, in_path);
     if (qmgr_message_count < var_qmgr_active_limit)
        if ((df_path = qmgr_scan_next(qmgr_deferred)) != 0)
            qmgr_active_feed(qmgr_deferred, df_path);
@@ -458,12 +459,15 @@ static int qmgr_loop(char *unused_name, char **unused_argv)
      * get ahead of the queue manager, but don't block them completely.
      */
     if (var_in_flow_delay > 0) {
-       if (in_path != 0)
-           mail_flow_put(1);
-       else if ((token_count = mail_flow_count()) < var_proc_limit)
-           mail_flow_put(var_proc_limit - token_count);
-       else if (token_count > var_proc_limit)
+       token_count = mail_flow_count();
+       if (token_count < var_proc_limit) {
+           if (in_feed != 0)
+               mail_flow_put(1);
+           else if (qmgr_incoming->handle == 0)
+               mail_flow_put(var_proc_limit - token_count);
+       } else if (token_count > var_proc_limit) {
            mail_flow_get(token_count - var_proc_limit);
+       }
     }
     if (in_path || df_path)
        return (DONT_WAIT);
index 2afbf440b7f3b88907373fbe727cb2d784e4906d..8749c35605c4c61346c6e6e929da35afec77ad06 100644 (file)
@@ -373,7 +373,7 @@ extern void qmgr_deliver(QMGR_TRANSPORT *, VSTREAM *);
  /*
   * qmgr_active.c
   */
-extern void qmgr_active_feed(QMGR_SCAN *, const char *);
+extern int qmgr_active_feed(QMGR_SCAN *, const char *);
 extern void qmgr_active_drain(void);
 extern void qmgr_active_done(QMGR_MESSAGE *);
 
index 8f28b068661a64d6e5df9a58eee36e8a35b67019..bb3e5a4206449185784ac83d27f3259d5bb6e23b 100644 (file)
@@ -164,7 +164,7 @@ static void qmgr_active_defer(const char *queue_name, const char *queue_id,
 
 /* qmgr_active_feed - feed one message into active queue */
 
-void    qmgr_active_feed(QMGR_SCAN *scan_info, const char *queue_id)
+int     qmgr_active_feed(QMGR_SCAN *scan_info, const char *queue_id)
 {
     char   *myname = "qmgr_active_feed";
     QMGR_MESSAGE *message;
@@ -180,7 +180,7 @@ void    qmgr_active_feed(QMGR_SCAN *scan_info, const char *queue_id)
      * Make sure this is something we are willing to open.
      */
     if (mail_open_ok(scan_info->queue, queue_id, &st, &path) == MAIL_OPEN_NO)
-       return;
+       return (0);
 
     if (msg_verbose)
        msg_info("%s: %s", myname, path);
@@ -194,7 +194,7 @@ void    qmgr_active_feed(QMGR_SCAN *scan_info, const char *queue_id)
        if (msg_verbose)
            msg_info("%s: skip %s (%ld seconds)", myname, queue_id,
                     (long) (st.st_mtime - event_time()));
-       return;
+       return (0);
     }
 
     /*
@@ -206,7 +206,7 @@ void    qmgr_active_feed(QMGR_SCAN *scan_info, const char *queue_id)
                      queue_id, scan_info->queue, MAIL_QUEUE_ACTIVE);
        msg_warn("%s: %s: rename from %s to %s: %m", myname,
                 queue_id, scan_info->queue, MAIL_QUEUE_ACTIVE);
-       return;
+       return (0);
     }
 
     /*
@@ -226,8 +226,10 @@ void    qmgr_active_feed(QMGR_SCAN *scan_info, const char *queue_id)
     if ((message = qmgr_message_alloc(MAIL_QUEUE_ACTIVE, queue_id,
                                      scan_info->flags)) == 0) {
        qmgr_active_corrupt(queue_id);
+       return (0);
     } else if (message == QMGR_MESSAGE_LOCKED) {
        qmgr_active_defer(MAIL_QUEUE_ACTIVE, queue_id, MAIL_QUEUE_INCOMING, 60);
+       return (0);
     } else {
 
        /*
@@ -236,6 +238,7 @@ void    qmgr_active_feed(QMGR_SCAN *scan_info, const char *queue_id)
         */
        if (message->refcount == 0)
            qmgr_active_done(message);
+       return (1);
     }
 }
 
index da7d5625eddaa46b34a956c2a207203a09f4736f..59433d4fc038f2ae1ee7c56344ef4f298f907ef2 100644 (file)
@@ -225,7 +225,7 @@ static void get_myhostname(void)
 {
     const char *name;
 
-    if ((name = dict_lookup(CONFIG_DICT, VAR_MYHOSTNAME)) == 0)
+    if ((name = mail_conf_lookup_eval(VAR_MYHOSTNAME)) == 0)
        name = check_myhostname();
     var_myhostname = mystrdup(name);
 }
@@ -255,13 +255,13 @@ static const char *check_mynetworks(void)
 
     if (var_inet_interfaces == 0) {
        if ((mode & SHOW_DEFS)
-           || !(junk = mail_conf_lookup(VAR_INET_INTERFACES)))
+           || !(junk = mail_conf_lookup_eval(VAR_INET_INTERFACES)))
            junk = DEF_INET_INTERFACES;
        var_inet_interfaces = mystrdup(junk);
     }
     if (var_mynetworks_style == 0) {
        if ((mode & SHOW_DEFS)
-           || !(junk = mail_conf_lookup(VAR_MYNETWORKS_STYLE)))
+           || !(junk = mail_conf_lookup_eval(VAR_MYNETWORKS_STYLE)))
            junk = DEF_MYNETWORKS_STYLE;
        var_mynetworks_style = mystrdup(junk);
     }
index 95a4e092a2a1a5e4478519eec97c217c7819eb04..146b2646933ddf36456d6628db647c8448c20e94 100644 (file)
@@ -382,6 +382,7 @@ static int qmgr_loop(char *unused_name, char **unused_argv)
     char   *in_path = 0;
     char   *df_path = 0;
     int     token_count;
+    int     in_feed = 0;
 
     /*
      * This routine runs as part of the event handling loop, after the event
@@ -409,7 +410,7 @@ static int qmgr_loop(char *unused_name, char **unused_argv)
     if (qmgr_message_count < var_qmgr_active_limit
        && qmgr_recipient_count < var_qmgr_rcpt_limit)
        if ((in_path = qmgr_scan_next(qmgr_incoming)) != 0)
-           qmgr_active_feed(qmgr_incoming, in_path);
+           in_feed = qmgr_active_feed(qmgr_incoming, in_path);
     if (qmgr_message_count < var_qmgr_active_limit
        && qmgr_recipient_count < var_qmgr_rcpt_limit)
        if ((df_path = qmgr_scan_next(qmgr_deferred)) != 0)
@@ -420,12 +421,15 @@ static int qmgr_loop(char *unused_name, char **unused_argv)
      * get ahead of the queue manager, but don't block them completely.
      */
     if (var_in_flow_delay > 0) {
-       if (in_path != 0)
-           mail_flow_put(1);
-       else if ((token_count = mail_flow_count()) < var_proc_limit)
-           mail_flow_put(var_proc_limit - token_count);
-       else if (token_count > var_proc_limit)
+       token_count = mail_flow_count();
+       if (token_count < var_proc_limit) {
+           if (in_feed != 0)
+               mail_flow_put(1);
+           else if (qmgr_incoming->handle == 0)
+               mail_flow_put(var_proc_limit - token_count);
+       } else if (token_count > var_proc_limit) {
            mail_flow_get(token_count - var_proc_limit);
+       }
     }
     if (in_path || df_path)
        return (DONT_WAIT);
index db55af124b3a3679a52b60b7a798e98b198df757..9839c07c20980e240f21ad8096c7c6df193ec5e7 100644 (file)
@@ -270,7 +270,7 @@ extern void qmgr_deliver(QMGR_TRANSPORT *, VSTREAM *);
  /*
   * qmgr_active.c
   */
-extern void qmgr_active_feed(QMGR_SCAN *, const char *);
+extern int qmgr_active_feed(QMGR_SCAN *, const char *);
 extern void qmgr_active_drain(void);
 extern void qmgr_active_done(QMGR_MESSAGE *);
 
index 8f28b068661a64d6e5df9a58eee36e8a35b67019..bb3e5a4206449185784ac83d27f3259d5bb6e23b 100644 (file)
@@ -164,7 +164,7 @@ static void qmgr_active_defer(const char *queue_name, const char *queue_id,
 
 /* qmgr_active_feed - feed one message into active queue */
 
-void    qmgr_active_feed(QMGR_SCAN *scan_info, const char *queue_id)
+int     qmgr_active_feed(QMGR_SCAN *scan_info, const char *queue_id)
 {
     char   *myname = "qmgr_active_feed";
     QMGR_MESSAGE *message;
@@ -180,7 +180,7 @@ void    qmgr_active_feed(QMGR_SCAN *scan_info, const char *queue_id)
      * Make sure this is something we are willing to open.
      */
     if (mail_open_ok(scan_info->queue, queue_id, &st, &path) == MAIL_OPEN_NO)
-       return;
+       return (0);
 
     if (msg_verbose)
        msg_info("%s: %s", myname, path);
@@ -194,7 +194,7 @@ void    qmgr_active_feed(QMGR_SCAN *scan_info, const char *queue_id)
        if (msg_verbose)
            msg_info("%s: skip %s (%ld seconds)", myname, queue_id,
                     (long) (st.st_mtime - event_time()));
-       return;
+       return (0);
     }
 
     /*
@@ -206,7 +206,7 @@ void    qmgr_active_feed(QMGR_SCAN *scan_info, const char *queue_id)
                      queue_id, scan_info->queue, MAIL_QUEUE_ACTIVE);
        msg_warn("%s: %s: rename from %s to %s: %m", myname,
                 queue_id, scan_info->queue, MAIL_QUEUE_ACTIVE);
-       return;
+       return (0);
     }
 
     /*
@@ -226,8 +226,10 @@ void    qmgr_active_feed(QMGR_SCAN *scan_info, const char *queue_id)
     if ((message = qmgr_message_alloc(MAIL_QUEUE_ACTIVE, queue_id,
                                      scan_info->flags)) == 0) {
        qmgr_active_corrupt(queue_id);
+       return (0);
     } else if (message == QMGR_MESSAGE_LOCKED) {
        qmgr_active_defer(MAIL_QUEUE_ACTIVE, queue_id, MAIL_QUEUE_INCOMING, 60);
+       return (0);
     } else {
 
        /*
@@ -236,6 +238,7 @@ void    qmgr_active_feed(QMGR_SCAN *scan_info, const char *queue_id)
         */
        if (message->refcount == 0)
            qmgr_active_done(message);
+       return (1);
     }
 }