diff --git a/postfix/HISTORY b/postfix/HISTORY
index 813c90c65..cee5cc5d3 100644
--- a/postfix/HISTORY
+++ b/postfix/HISTORY
@@ -4925,10 +4925,29 @@ Apologies for any names omitted.
Portability: MACOSX patches by Gerben Wierda.
Portability: Solaris /dev/null is a symlink, which tripped
- up the code to safely open a file before delivery. We now
+ up the code to safely open a file before local delivery. We now
grudgingly allow symlinks owned by root. File: util/safe_open.c.
20010224
Bugfix: "postconf mynetworks" ignored the inet_interfaces
setting. That was a very old one. File: postconf/postconf.c.
+
+ INCOMPATIBLE CHANGE: POSTFIX NO LONGER RELAYS MAIL FOR
+ CLIENTS IN THE ENTIRE CLASS A/B/C NETWORK. POSTFIX BY
+ DEFAULT RELAYS MAIL FOR CLIENTS IN THE LOCAL SUBNETWORK.
+ Specify "mynetworks_style = class" to get the old behavior.
+
+20010225
+
+ Portability: master sigchld handler based on writing to a
+ pipe, so that the master wakes up from select(). Based on
+ code by Erik Forsberg, Linkoping University, Sweden. File:
+ master/master_sig.c. Disabled until after the major release.
+
+ Code cleanup: Postfix should now run with no alias database.
+
+ Code cleanup: local_destination_recipient_limit and
+ local_destination_concurrency_limit are not first-class
+ configuration parameters. Files: global/mail_params.h,
+ *qmgr/qmgr.c, postconf/postconf.c.
diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES
index 1cfc98c8e..6c8a4c82d 100644
--- a/postfix/RELEASE_NOTES
+++ b/postfix/RELEASE_NOTES
@@ -1,3 +1,11 @@
+Incompatible changes with snapshot-20010225
+===========================================
+
+POSTFIX NO LONGER RELAYS MAIL FOR CLIENTS IN THE ENTIRE CLASS A/B/C
+NETWORK. To get the old behavior, specify "mynetworks_style = class"
+in the main.cf file. The default (mynetworks_style = subnet) is to
+relay for clients in the local IP subnet. See conf/main.cf.
+
Incompatible changes with snapshot-20010222
===========================================
diff --git a/postfix/conf/main.cf b/postfix/conf/main.cf
index b6476b6c5..a618ef772 100644
--- a/postfix/conf/main.cf
+++ b/postfix/conf/main.cf
@@ -120,37 +120,35 @@ mail_owner = postfix
#mydestination = $myhostname, localhost.$mydomain, $mydomain,
# mail.$mydomain, www.$mydomain, ftp.$mydomain
-# RELAY CONTROL
+# TRUST AND RELAY CONTROL
-# The mynetworks parameter specifies the list of networks that make
-# up the local neighborhood. The list is used by the anti-UCE
-# software to relay authorize clients. See the check_relay_domains
-# and and smtpd_recipient_restrictions in the sample-smtpd.cf file.
+# The mynetworks parameter specifies the list of "trusted" SMTP
+# clients that have more privileges than "strangers".
#
-# By default, Postfix derives the mynetworks setting from the local
-# machine network addresses.
-
-# The mynetworks_style parameter specifies how Postfix computes the
-# mynetworks default value from the local machine network addresses.
+# In particular, "trusted" SMTP clients are allowed to relay mail
+# through Postfix. See the smtpd_recipient_restrictions parameter
+# in file sample-smtpd.cf.
#
-# By default (mynetworks_style = subnet), Postfix relay authorizes
-# all clients in the subnets that are attached to this machine.
+# By default (mynetworks_style = subnet), Postfix "trusts" SMTP
+# clients in the same IP subnetworks as the local machine.
+# On Linux, this does works correctly only with interfaces specified
+# with the "ifconfig" command.
#
-# Specify "mynetworks_style = class" when you want to relay authorize
-# all clients in the class A, B or C networks that are attached to
-# to this machine.
+# Specify "mynetworks_style = class" when Postfix should "trust" SMTP
+# clients in the same IP class A/B/C networks as the local machine.
+# This used to be the default. It is appropriate for service providers.
#
-# Specify "mynetworks_style = host" if you do not want to relay
-# authorize clients other than the local machine.
+# Specify "mynetworks_style = host" when Postfix should "trust"
+# only the local machine.
#
# mynetworks_style = class
# mynetworks_style = subnet
# mynetworks_style = host
-# Instead of implicitly deriving the mynetworks value from local
-# machine addresses, you can specify an explicit list of network/mask
-# patterns, where the mask specifies the number of bits in the network
-# part of a host address.
+# Instead of using mynetworks_style to implicitly derive the mynetworks
+# list from local machine addresses, you can specify an explicit list
+# of network/netmask patterns, where the mask specifies the number of
+# bits in the network part of a host address.
#
# You can also specify the absolute pathname of a pattern file instead
# of listing the patterns here.
@@ -430,10 +428,11 @@ mail_owner = postfix
# raise eyebrows.
#
# Each message delivery transport has its XXX_destination_concurrency_limit
-# parameter. The default is $default_destination_concurrency_limit.
+# parameter. The default is $default_destination_concurrency_limit for
+# most delivery transports. For the local delivery agent the default is 2.
-local_destination_concurrency_limit = 2
-default_destination_concurrency_limit = 10
+#local_destination_concurrency_limit = 2
+#default_destination_concurrency_limit = 10
# DEBUGGING CONTROL
#
diff --git a/postfix/conf/postfix-script-nosgid b/postfix/conf/postfix-script-nosgid
index d2374041a..2c5d43ae2 100755
--- a/postfix/conf/postfix-script-nosgid
+++ b/postfix/conf/postfix-script-nosgid
@@ -247,6 +247,8 @@ EOF
(echo "$found" | grep bounce >/dev/null) || missing="$missing bounce"
(echo "$found" | grep defer >/dev/null) || missing="$missing defer"
(echo "$found" | grep flush >/dev/null) || missing="$missing flush"
+ (echo "$found" | grep incoming>/dev/null)|| missing="$missing incoming"
+ (echo "$found" | grep deferred>/dev/null)|| missing="$missing deferred"
test -n "$missing" && {
$WARN fixing main.cf hash_queue_names for missing $missing
$command_directory/postconf -e hash_queue_names="$found$missing"
diff --git a/postfix/conf/postfix-script-sgid b/postfix/conf/postfix-script-sgid
index f86fdc3c9..a635ef679 100755
--- a/postfix/conf/postfix-script-sgid
+++ b/postfix/conf/postfix-script-sgid
@@ -248,6 +248,8 @@ EOF
(echo "$found" | grep bounce >/dev/null) || missing="$missing bounce"
(echo "$found" | grep defer >/dev/null) || missing="$missing defer"
(echo "$found" | grep flush >/dev/null) || missing="$missing flush"
+ (echo "$found" | grep incoming>/dev/null)|| missing="$missing incoming"
+ (echo "$found" | grep deferred>/dev/null)|| missing="$missing deferred"
test -n "$missing" && {
$WARN fixing main.cf hash_queue_names for missing $missing
$command_directory/postconf -e hash_queue_names="$found$missing"
diff --git a/postfix/conf/sample-misc.cf b/postfix/conf/sample-misc.cf
index ed7b57db4..27ddd9a75 100644
--- a/postfix/conf/sample-misc.cf
+++ b/postfix/conf/sample-misc.cf
@@ -211,23 +211,34 @@ mydestination = $myhostname, localhost.$mydomain
# myorigin = $mydomain
myorigin = $myhostname
-# The mynetworks parameter specifies the list of networks that are
-# local to this machine. The list is used by the anti-UCE software
-# to distinguish local clients from strangers. See permit_mynetworks
-# in the sample-smtpd.cf file.
+# The mynetworks parameter specifies the list of "trusted" SMTP
+# clients that have more privileges than "strangers".
#
-# The mynetworks parameter specifies the list of networks that are
-# local to this machine. The list is used by the anti-UCE software
-# to distinguish local clients from strangers. See permit_mynetworks
-# and smtpd_recipient_restrictions in the file sample-smtpd.cf file.
+# In particular, "trusted" SMTP clients are allowed to relay mail
+# through Postfix. See the smtpd_recipient_restrictions parameter
+# in file sample-smtpd.cf.
#
-# The default is a list of all networks attached to the machine: a
-# complete class A network (X.0.0.0/8), a complete class B network
-# (X.X.0.0/16), and so on. If you want stricter control, specify a
-# list of network/mask patterns, where the mask specifies the number
-# of bits in the network part of a host address. You can also specify
-# the absolute pathname of a pattern file instead of listing the
-# patterns here.
+# By default (mynetworks_style = subnet), Postfix "trusts" SMTP
+# clients in the same IP subnetworks as the local machine.
+#
+# Specify "mynetworks_style = class" when Postfix should "trust" SMTP
+# clients in the same IP class A/B/C networks as the local machine.
+# This used to be the default. It is appropriate for service providers.
+#
+# Specify "mynetworks_style = host" when Postfix should "trust"
+# only the local machine.
+#
+# mynetworks_style = class
+# mynetworks_style = subnet
+# mynetworks_style = host
+
+# Instead of using mynetworks_style to implicitly derive the mynetworks
+# list from local machine addresses, you can specify an explicit list
+# of network/netmask patterns, where the mask specifies the number of
+# bits in the network part of a host address.
+#
+# You can also specify the absolute pathname of a pattern file instead
+# of listing the patterns here.
#
#mynetworks = 168.100.189.0/28, 127.0.0.0/8
diff --git a/postfix/conf/sample-smtpd.cf b/postfix/conf/sample-smtpd.cf
index 56f301800..aa80fd291 100644
--- a/postfix/conf/sample-smtpd.cf
+++ b/postfix/conf/sample-smtpd.cf
@@ -101,6 +101,38 @@ smtpd_hard_error_limit = 100
# UCE RESTRICTIONS
#
+# The mynetworks parameter specifies the list of "trusted" SMTP
+# clients that have more privileges than "strangers".
+#
+# In particular, "trusted" SMTP clients are allowed to relay mail
+# through Postfix. See the smtpd_recipient_restrictions parameter
+# in file sample-smtpd.cf.
+#
+# By default (mynetworks_style = subnet), Postfix "trusts" SMTP
+# clients in the same IP subnetworks as the local machine.
+#
+# Specify "mynetworks_style = class" when Postfix should "trust" SMTP
+# clients in the same IP class A/B/C networks as the local machine.
+# This used to be the default. It is appropriate for service providers.
+#
+# Specify "mynetworks_style = host" when Postfix should "trust"
+# only the local machine.
+#
+# mynetworks_style = class
+mynetworks_style = subnet
+# mynetworks_style = host
+
+# Instead of using mynetworks_style to implicitly derive the mynetworks
+# list from local machine addresses, you can specify an explicit list
+# of network/netmask patterns, where the mask specifies the number of
+# bits in the network part of a host address.
+#
+# You can also specify the absolute pathname of a pattern file instead
+# of listing the patterns here.
+#
+#mynetworks = 168.100.189.0/28, 127.0.0.0/8
+#mynetworks = $config_directory/mynetworks
+
# The smtpd_client_restrictions parameter specifies optional restrictions
# on SMTP client host names and addresses.
#
diff --git a/postfix/html/basic.html b/postfix/html/basic.html
index a769d5619..d0fb4f374 100644
--- a/postfix/html/basic.html
+++ b/postfix/html/basic.html
@@ -163,27 +163,20 @@ hostnames of the machine, including $myhostname, and localhost.$mydomain.
What clients to relay mail for
-By default, Postfix will relay mail for clients in relay authorized
-networks and in relay authorized domains.
+By default, Postfix will relay mail for clients in authorized
+networks and in authorized domains.
-Relay authorized client networks are defined by the mynetworks parameter. The default is to -relay authorize all clients in all class A, B or C networks that -are attached to the machine. +authorize all clients in the IP subnetworks that the local machine +is attached to.
-YOU MUST CHANGE THIS DEFAULT SETTING -IF YOUR ADDRESS BLOCK IS PART OF A LARGER ADDRESS RANGE THAT IS -OWNED BY YOUR PROVIDER - IT WOULD CAUSE POSTFIX TO RELAY MAIL FROM -ALL THEIR CUSTOMERS. - -
-
-Relay authorized client domains are by defined by the relay_domains comfiguration
+Authorized client domains are by defined by the relay_domains configuration
parameter. The default setting trusts clients with hostnames below
the domain(s) listed in mydestination.
@@ -315,18 +308,54 @@ top-level domain).
My own networks
The mynetworks parameter lists all networks that this machine
-is attached to. This information can be used by the
-anti-UCE features to distinguish between relay authorized
-clients and relay unauthorized strangers.
+somehow trusts. This information can be used by the
+anti-UCE features to recognize trusted SMTP clients that are
+allowed to relay mail through Postfix.
-By default, mynetworks is set to the class A, B or C networks -that the machine is attached to. For example, for my machines at -home, the result is: 168.100.0.0/16 127.0.0.0/8. However, -network 168.100 is owned by my ISP. Of course I do not want -to consider all their customer systems as relay authorized clients, -so I use instead: +You can specify the list of trusted networks in the main.cf +file, or you can let Postfix deduce the list for you. The default +is to let Postfix do the work for you. + +
+ +
+ +
+ +
+ +
+ +
+ +To specify the list of trusted networks by hand, specify +network blocks in CIDR (network/mask) notation, for example: + +
+ +You even have to specify explicit machine interfaces for the +non-virtual mailer that receives mail for the machine itself: the +non-virtual mailer should never listen on the virtual interfaces +or you would have a mailer loop.
+
+
+
Postfix warnings and error messages
+
+
+
+
+
+Sendmail incompatibility
@@ -116,16 +138,7 @@ distribution list
-
-
+ +
+ # newaliases ++ +
+The following information is kernel version dependent. + +
+ To set parameters at boot time on Linux systems that have /etc/sysctl.conf, add the following lines: @@ -911,7 +945,7 @@ commands as root:
@@ -934,14 +968,16 @@ You solve the problem by getting faster disks.-I am still solving the scheduling problem from the software side. +I am still solving the scheduling problem from the software side, +but don't hold your breath.
Currently, the workaround is to configure multiple IP addresses -per machine, and to run one Postfix instance per IP address. The -Postfix instances can't share queue directories, but sharing mailbox -directories is OK. +per machine, and to run one Postfix instance per IP address, each +instance preferably on a different disk. The Postfix instances +can't share queue directories, but sharing mailbox directories is +OK.
@@ -962,9 +998,10 @@ depending on the interface that it is supposed to handle.
- queue_directory = /my/own/queue/directory - myhostname = foo1.my.domain - inet_interfaces = $myhostname + /my/own/main.cf: + queue_directory = /my/own/queue/directory + myhostname = foo1.my.domain + inet_interfaces = $myhostname
@@ -1347,7 +1384,8 @@ host.Configuring Postfix as backup MX host
-When you are SECONDARY MX for some other domain this is all you need: +When you are secondary mx for a remote site this is +all you need:@@ -1356,12 +1394,14 @@ When you are SECONDARY MX for some other domain this is all you need: the.backed-up.domain.name IN MX 100 your.machine.name /etc/postfix/main.cf: - relay_domains = the.backed-up.domain.name + relay_domains = $mydestination the.backed-up.domain.name + smtpd_recipient_restrictions = permit_mynetworks check_relay_domains
-When you are PRIMARY MX for some other domain you also need: +When you are primary mx for a remote site you also +need:
@@ -1381,11 +1421,11 @@ types Postfix supports, use the command postconf -m.
-All remote mail stays queued with: Host not found, try again
+Mail stays queued with: Host not found, try again
-When I connect send mail to a remote address, the following happens: +When I send mail to a remote address, the following happens:@@ -1397,15 +1437,35 @@ When I connect send mail to a remote address, the following happens: service error for domain recip.domain: Host not found, try again) +
+ +However, I can nslookup the hostname just fine. +
+There can be several different problems. + +
+ +
+ +
+- First of all, the result of nslookup for the hostname may be +irrelevant. Postfix is required to look up the MX record first. So +your nslookup test should begin with asking for the MX record. Some +DNS servers are broken and produce no reply when asked for a +non-existent MX record. + +
- + Check out your Postfix master.cf file. If the SMTP client runs chrooted, then it needs a bunch of files inside the Postfix queue directory. Examples are in the source distribution in the examples subdirectory. +
Mail fails consistently with timeout or lost connection
@@ -1641,7 +1701,36 @@ specify:To enable the comsat network service, uncomment the -corresponding entry in the inetd.conf file. +corresponding entry in the inetd.conf file, and kill -HUP +the inetd process. + +
+ +What does "NIS domain name not set - NIS lookups disabled" mean?
+ ++ +The warning message means that NIS (Network Information Service) +is not enabled on your machine. That is perfectly OK. It's just +hard for Postfix to find out about these things ahead of time. + +
+ +To disable the NIS client code in the Postfix local delivery agent, +update the corresponding section in the main.cf file and specify +one of the following, depending on the type of aliases file: + +
+ +
+/etc/postfix/main.cf: + alias_maps = $alias_database ++ ++ +This forces Postfix to use only the local aliases database, if one +is defined.
diff --git a/postfix/html/uce.html b/postfix/html/uce.html index 1fe7b0cbf..6333a381c 100644 --- a/postfix/html/uce.html +++ b/postfix/html/uce.html @@ -109,7 +109,8 @@ is allowed in message headers.Syntax: Specify a list of zero or more lookup tables. Whenever a header -matches a table, a REJECT result means reject the message. +matches a table, a REJECT result means reject the message, and a +SKIP result means delete the header from the message. diff --git a/postfix/src/global/mail_params.c b/postfix/src/global/mail_params.c index 52cf7e61b..ed04630aa 100644 --- a/postfix/src/global/mail_params.c +++ b/postfix/src/global/mail_params.c @@ -282,7 +282,7 @@ void mail_params_init() VAR_INET_INTERFACES, DEF_INET_INTERFACES, &var_inet_interfaces, 1, 0, VAR_DOUBLE_BOUNCE, DEF_DOUBLE_BOUNCE, &var_double_bounce_sender, 1, 0, VAR_DEFAULT_PRIVS, DEF_DEFAULT_PRIVS, &var_default_privs, 1, 0, - VAR_ALIAS_DB_MAP, DEF_ALIAS_DB_MAP, &var_alias_db_map, 1, 0, + VAR_ALIAS_DB_MAP, DEF_ALIAS_DB_MAP, &var_alias_db_map, 0, 0, VAR_MAIL_VERSION, DEF_MAIL_VERSION, &var_mail_version, 1, 0, VAR_DB_TYPE, DEF_DB_TYPE, &var_db_type, 1, 0, VAR_HASH_QUEUE_NAMES, DEF_HASH_QUEUE_NAMES, &var_hash_queue_names, 1, 0, diff --git a/postfix/src/global/mail_params.h b/postfix/src/global/mail_params.h index 02eb7fd6a..294fd1fc5 100644 --- a/postfix/src/global/mail_params.h +++ b/postfix/src/global/mail_params.h @@ -530,6 +530,10 @@ extern int var_init_dest_concurrency; #define DEF_DEST_CON_LIMIT 10 extern int var_dest_con_limit; +#define VAR_LOCAL_CON_LIMIT "local" _DEST_CON_LIMIT +#define DEF_LOCAL_CON_LIMIT 2 +extern int var_local_con_lim; + /* * Queue manager: default number of recipients per transaction. */ @@ -540,6 +544,7 @@ extern int var_dest_rcpt_limit; #define VAR_LOCAL_RCPT_LIMIT "local" _DEST_RCPT_LIMIT /* XXX */ #define DEF_LOCAL_RCPT_LIMIT 1 /* XXX */ +extern int var_local_rcpt_lim; /* * Queue manager: default delay before retrying a dead transport. diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 291dc89bd..d1dadc6b3 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-20010224" +#define DEF_MAIL_VERSION "Snapshot-20010225" extern char *var_mail_version; /* LICENSE diff --git a/postfix/src/master/master_sig.c b/postfix/src/master/master_sig.c index 0ad0fa7b1..a113b13c6 100644 --- a/postfix/src/master/master_sig.c +++ b/postfix/src/master/master_sig.c @@ -56,6 +56,17 @@ /* Local stuff. */ +#ifdef USE_SIG_PIPE +#include
+#include +#include + +int master_sig_pipe[2]; + +#define SIG_PIPE_WRITE_FD master_sig_pipe[1] +#define SIG_PIPE_READ_FD master_sig_pipe[0] +#endif + int master_gotsigchld; int master_gotsighup; @@ -99,6 +110,29 @@ static void master_sigchld(int sig, int code, struct sigcontext * scp) #else +#ifdef USE_SIG_PIPE + +/* master_sigchld - force wakeup from select() */ + +static void master_sigchld(int sig) +{ + if (write(SIG_PIPE_WRITE_FD, "", 1) != 1) + msg_warn("write to SIG_PIPE_WRITE_FD failed: %m"); +} + +/* master_sig_event - called upon return from select() */ + +static void master_sig_event(int unused_event, char *unused_context) +{ + char c[1]; + + while (read(SIG_PIPE_READ_FD, c, 1) > 0) + /* void */ ; + master_gotsigchld = 1; +} + +#else + static void master_sigchld(int sig) { @@ -111,6 +145,7 @@ static void master_sigchld(int sig) master_gotsigchld = sig; } +#endif #endif /* master_sigdeath - die, women and children first */ @@ -174,6 +209,14 @@ void master_sigsetup(void) if (sigaction(sigs[i], &action, (struct sigaction *) 0) < 0) msg_fatal("%s: sigaction(%d): %m", myname, sigs[i]); +#ifdef USE_SIG_PIPE + if (pipe(master_sig_pipe)) + msg_fatal("pipe: %m"); + non_blocking(SIG_PIPE_WRITE_FD, NON_BLOCKING); + non_blocking(SIG_PIPE_READ_FD, NON_BLOCKING); + event_enable_read(SIG_PIPE_READ_FD, master_sig_event, (char *) 0); +#endif + /* * Intercept SIGHUP (re-read config file) and SIGCHLD (child exit). */ diff --git a/postfix/src/nqmgr/qmgr.c b/postfix/src/nqmgr/qmgr.c index c7cbd62c5..030c82d2d 100644 --- a/postfix/src/nqmgr/qmgr.c +++ b/postfix/src/nqmgr/qmgr.c @@ -332,6 +332,8 @@ char *var_relocated_maps; char *var_virtual_maps; char *var_defer_xports; bool var_allow_min_user; +int var_local_con_lim; +int var_local_rcpt_lim; static QMGR_SCAN *qmgr_incoming; static QMGR_SCAN *qmgr_deferred; @@ -530,6 +532,8 @@ int main(int argc, char **argv) VAR_INIT_DEST_CON, DEF_INIT_DEST_CON, &var_init_dest_concurrency, 1, 0, VAR_DEST_CON_LIMIT, DEF_DEST_CON_LIMIT, &var_dest_con_limit, 0, 0, VAR_DEST_RCPT_LIMIT, DEF_DEST_RCPT_LIMIT, &var_dest_rcpt_limit, 0, 0, + VAR_LOCAL_RCPT_LIMIT, DEF_LOCAL_RCPT_LIMIT, &var_local_rcpt_lim, 0, 0, + VAR_LOCAL_CON_LIMIT, DEF_LOCAL_CON_LIMIT, &var_local_con_lim, 0, 0, 0, }; static CONFIG_BOOL_TABLE bool_table[] = { diff --git a/postfix/src/postconf/Makefile.in b/postfix/src/postconf/Makefile.in index c5d00c038..1cf467723 100644 --- a/postfix/src/postconf/Makefile.in +++ b/postfix/src/postconf/Makefile.in @@ -94,12 +94,10 @@ postconf.o: bool_vars.h postconf.o: int_vars.h postconf.o: str_vars.h postconf.o: raw_vars.h -postconf.o: local_vars.h postconf.o: smtp_vars.h postconf.o: time_table.h postconf.o: bool_table.h postconf.o: int_table.h postconf.o: str_table.h -postconf.o: local_table.h postconf.o: smtp_table.h postconf.o: raw_table.h diff --git a/postfix/src/postconf/local_table.h b/postfix/src/postconf/local_table.h deleted file mode 100644 index c612ab7d1..000000000 --- a/postfix/src/postconf/local_table.h +++ /dev/null @@ -1 +0,0 @@ - "local_destination_concurrency_limit", "$default_destination_concurrency_limit", &var_local_destination_concurrency_limit, 0, 0, diff --git a/postfix/src/postconf/local_vars.h b/postfix/src/postconf/local_vars.h deleted file mode 100644 index c09dc1473..000000000 --- a/postfix/src/postconf/local_vars.h +++ /dev/null @@ -1 +0,0 @@ -char *var_local_destination_concurrency_limit; diff --git a/postfix/src/postconf/postconf.c b/postfix/src/postconf/postconf.c index 512ed8ed9..da7d5625e 100644 --- a/postfix/src/postconf/postconf.c +++ b/postfix/src/postconf/postconf.c @@ -130,7 +130,6 @@ DICT *text_table; /* * Manually extracted. */ -#include "local_vars.h" #include "smtp_vars.h" /* @@ -153,7 +152,6 @@ static CONFIG_INT_TABLE int_table[] = { static CONFIG_STR_TABLE str_table[] = { #include "str_table.h" -#include "local_table.h" /* XXX */ #include "smtp_table.h" /* XXX */ 0, }; diff --git a/postfix/src/qmgr/qmgr.c b/postfix/src/qmgr/qmgr.c index 97488cd63..7513aa368 100644 --- a/postfix/src/qmgr/qmgr.c +++ b/postfix/src/qmgr/qmgr.c @@ -292,6 +292,7 @@ bool var_allow_min_user; int var_qmgr_fudge; int var_qmgr_hog; int var_local_rcpt_lim; /* XXX */ +int var_local_con_lim; /* XXX */ static QMGR_SCAN *qmgr_incoming; static QMGR_SCAN *qmgr_deferred; @@ -489,6 +490,7 @@ int main(int argc, char **argv) VAR_QMGR_FUDGE, DEF_QMGR_FUDGE, &var_qmgr_fudge, 10, 100, VAR_QMGR_HOG, DEF_QMGR_HOG, &var_qmgr_hog, 10, 100, VAR_LOCAL_RCPT_LIMIT, DEF_LOCAL_RCPT_LIMIT, &var_local_rcpt_lim, 0, 0, + VAR_LOCAL_CON_LIMIT, DEF_LOCAL_CON_LIMIT, &var_local_con_lim, 0, 0, 0, }; static CONFIG_BOOL_TABLE bool_table[] = { diff --git a/postfix/src/util/inet_addr_local.c b/postfix/src/util/inet_addr_local.c index 5eca34397..0a3cb22a8 100644 --- a/postfix/src/util/inet_addr_local.c +++ b/postfix/src/util/inet_addr_local.c @@ -15,8 +15,8 @@ /* specified address list. The result value is the number of /* active interfaces found. /* -/* The mask_list is either a null pointer, or it is an list -/* that receives the netmasks corresponding to the address list. +/* The mask_list is either a null pointer, or it is a list that +/* receives the netmasks of the interface addresses that were found. /* DIAGNOSTICS /* Fatal errors: out of memory. /* SEE ALSO @@ -46,6 +46,7 @@ #include #endif #include +#include /* Utility library. */ @@ -61,12 +62,15 @@ #ifdef _SIZEOF_ADDR_IFREQ #define NEXT_INTERFACE(ifr) ((struct ifreq *) \ ((char *) ifr + _SIZEOF_ADDR_IFREQ(*ifr))) +#define IFREQ_SIZE(ifr) _SIZEOF_ADDR_IFREQ(*ifr) #else #ifdef HAS_SA_LEN #define NEXT_INTERFACE(ifr) ((struct ifreq *) \ ((char *) ifr + sizeof(ifr->ifr_name) + ifr->ifr_addr.sa_len)) +#define IFREQ_SIZE(ifr) (sizeof(ifr->ifr_name) + ifr->ifr_addr.sa_len) #else #define NEXT_INTERFACE(ifr) (ifr + 1) +#define IFREQ_SIZE(ifr) sizeof(ifr[0]) #endif #endif @@ -82,6 +86,7 @@ int inet_addr_local(INET_ADDR_LIST *addr_list, INET_ADDR_LIST *mask_list) VSTRING *buf = vstring_alloc(1024); int initial_count = addr_list->used; struct in_addr addr; + struct ifreq *ifr_mask; if ((sock = socket(PF_INET, SOCK_DGRAM, 0)) < 0) msg_fatal("%s: socket: %m", myname); @@ -126,10 +131,13 @@ int inet_addr_local(INET_ADDR_LIST *addr_list, INET_ADDR_LIST *mask_list) if (addr.s_addr != INADDR_ANY) { /* has IP address */ inet_addr_list_append(addr_list, &addr); if (mask_list) { - if (ioctl(sock, SIOCGIFNETMASK, ifr) < 0) + ifr_mask = (struct ifreq *) mymalloc(IFREQ_SIZE(ifr)); + memcpy((char *) ifr_mask, (char *) ifr, IFREQ_SIZE(ifr)); + if (ioctl(sock, SIOCGIFNETMASK, ifr_mask) < 0) msg_fatal("%s: ioctl SIOCGIFNETMASK: %m", myname); - addr = ((struct sockaddr_in *) & ifr->ifr_addr)->sin_addr; + addr = ((struct sockaddr_in *) & ifr_mask->ifr_addr)->sin_addr; inet_addr_list_append(mask_list, &addr); + myfree((char *) ifr_mask); } } }