From: Wietse Venema Date: Wed, 1 Aug 2001 05:00:00 +0000 (-0500) Subject: snapshot-20010801 X-Git-Tag: v1.1.0~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb91b741afa87f3cdf603ad19ad2af787de0cbd5;p=thirdparty%2Fpostfix.git snapshot-20010801 --- diff --git a/postfix/FILTER_README b/postfix/FILTER_README index 07557a7a5..99bf9b050 100644 --- a/postfix/FILTER_README +++ b/postfix/FILTER_README @@ -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 EX_TEMPFAIL=75 diff --git a/postfix/HISTORY b/postfix/HISTORY index 0a42ce0b6..e3d94f5d4 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -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. diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index 721d02f59..026c4140f 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -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 diff --git a/postfix/conf/main.cf b/postfix/conf/main.cf index 5e6b2c4c8..9bd6bcd61 100644 --- a/postfix/conf/main.cf +++ b/postfix/conf/main.cf @@ -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 diff --git a/postfix/conf/sample-smtpd.cf b/postfix/conf/sample-smtpd.cf index 1429a5e74..082cb760c 100644 --- a/postfix/conf/sample-smtpd.cf +++ b/postfix/conf/sample-smtpd.cf @@ -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. diff --git a/postfix/src/cleanup/cleanup.c b/postfix/src/cleanup/cleanup.c index 7e7b369ad..3026f9740 100644 --- a/postfix/src/cleanup/cleanup.c +++ b/postfix/src/cleanup/cleanup.c @@ -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); } diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 234a54fe4..2e2aa1b6c 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -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 diff --git a/postfix/src/master/multi_server.c b/postfix/src/master/multi_server.c index 746e7c033..0be6a6335 100644 --- a/postfix/src/master/multi_server.c +++ b/postfix/src/master/multi_server.c @@ -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); diff --git a/postfix/src/master/single_server.c b/postfix/src/master/single_server.c index 5860fc798..21079f8e9 100644 --- a/postfix/src/master/single_server.c +++ b/postfix/src/master/single_server.c @@ -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); diff --git a/postfix/src/master/trigger_server.c b/postfix/src/master/trigger_server.c index 62ce674aa..c84b8a8b5 100644 --- a/postfix/src/master/trigger_server.c +++ b/postfix/src/master/trigger_server.c @@ -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); diff --git a/postfix/src/nqmgr/qmgr.c b/postfix/src/nqmgr/qmgr.c index 438691b50..e259e47aa 100644 --- a/postfix/src/nqmgr/qmgr.c +++ b/postfix/src/nqmgr/qmgr.c @@ -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); diff --git a/postfix/src/nqmgr/qmgr.h b/postfix/src/nqmgr/qmgr.h index 2afbf440b..8749c3560 100644 --- a/postfix/src/nqmgr/qmgr.h +++ b/postfix/src/nqmgr/qmgr.h @@ -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 *); diff --git a/postfix/src/nqmgr/qmgr_active.c b/postfix/src/nqmgr/qmgr_active.c index 8f28b0686..bb3e5a420 100644 --- a/postfix/src/nqmgr/qmgr_active.c +++ b/postfix/src/nqmgr/qmgr_active.c @@ -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); } } diff --git a/postfix/src/postconf/postconf.c b/postfix/src/postconf/postconf.c index da7d5625e..59433d4fc 100644 --- a/postfix/src/postconf/postconf.c +++ b/postfix/src/postconf/postconf.c @@ -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); } diff --git a/postfix/src/qmgr/qmgr.c b/postfix/src/qmgr/qmgr.c index 95a4e092a..146b26469 100644 --- a/postfix/src/qmgr/qmgr.c +++ b/postfix/src/qmgr/qmgr.c @@ -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); diff --git a/postfix/src/qmgr/qmgr.h b/postfix/src/qmgr/qmgr.h index db55af124..9839c07c2 100644 --- a/postfix/src/qmgr/qmgr.h +++ b/postfix/src/qmgr/qmgr.h @@ -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 *); diff --git a/postfix/src/qmgr/qmgr_active.c b/postfix/src/qmgr/qmgr_active.c index 8f28b0686..bb3e5a420 100644 --- a/postfix/src/qmgr/qmgr_active.c +++ b/postfix/src/qmgr/qmgr_active.c @@ -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); } }