# Localize these
INSPECT_DIR=/var/spool/filter
- SENDMAIL=/usr/sbin/sendmail
+ SENDMAIL="/usr/sbin/sendmail -i"
# Exit codes from <sysexits.h>
EX_TEMPFAIL=75
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.
-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
# 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
# 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.
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);
}
* 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
/* 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
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);
}
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);
/* 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
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)
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);
/* 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
*/
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);
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);
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
*/
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);
* 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);
/*
* 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 *);
/* 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;
* 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);
if (msg_verbose)
msg_info("%s: skip %s (%ld seconds)", myname, queue_id,
(long) (st.st_mtime - event_time()));
- return;
+ return (0);
}
/*
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);
}
/*
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 {
/*
*/
if (message->refcount == 0)
qmgr_active_done(message);
+ return (1);
}
}
{
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);
}
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);
}
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
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)
* 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);
/*
* 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 *);
/* 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;
* 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);
if (msg_verbose)
msg_info("%s: skip %s (%ld seconds)", myname, queue_id,
(long) (st.st_mtime - event_time()));
- return;
+ return (0);
}
/*
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);
}
/*
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 {
/*
*/
if (message->refcount == 0)
qmgr_active_done(message);
+ return (1);
}
}