diff --git a/postfix/.indent.pro b/postfix/.indent.pro
index 76ec68cd6..789741ca4 100644
--- a/postfix/.indent.pro
+++ b/postfix/.indent.pro
@@ -97,6 +97,7 @@
-TDICT_REGEXP_RULE
-TDICT_SDBM
-TDICT_SQLITE
+-TDICT_STACK
-TDICT_TCP
-TDICT_TEXT
-TDICT_UNIX
@@ -185,6 +186,8 @@
-TNAME_CODE
-TNAME_MASK
-TNBBIO
+-TPC_SERVICE_DEF
+-TPC_STRING_NV
-TPEER_NAME
-TPGSQL_NAME
-TPICKUP_INFO
@@ -266,7 +269,6 @@
-TSSL_CTX
-TSSL_SESSION
-TSTRING_LIST
--TSTRING_NV
-TSTRING_TABLE
-TSYS_EXITS_DETAIL
-TTLSMGR_SCACHE
diff --git a/postfix/HISTORY b/postfix/HISTORY
index 13ef279d8..31a3b66c5 100644
--- a/postfix/HISTORY
+++ b/postfix/HISTORY
@@ -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.
diff --git a/postfix/conf/main.cf b/postfix/conf/main.cf
index ca28c9319..8d301aa98 100644
--- a/postfix/conf/main.cf
+++ b/postfix/conf/main.cf
@@ -654,3 +654,4 @@ sample_directory =
# readme_directory: The location of the Postfix README files.
#
readme_directory =
+inet_protocols = ipv4
diff --git a/postfix/html/master.8.html b/postfix/html/master.8.html
index f7875b583..db08b69fe 100644
--- a/postfix/html/master.8.html
+++ b/postfix/html/master.8.html
@@ -186,7 +186,7 @@ MASTER(8) MASTER(8)
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
diff --git a/postfix/html/postconf.1.html b/postfix/html/postconf.1.html
index b2ce99e84..1b27e795b 100644
--- a/postfix/html/postconf.1.html
+++ b/postfix/html/postconf.1.html
@@ -270,10 +270,10 @@ POSTCONF(1) POSTCONF(1)
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 parame-
- ter" warning.
+ postconf(1) may log "unused parameter" warnings for mas-
+ ter.cf entries with "-o user-defined-name=value".
+ Addressing this limitation requires support for per-ser-
+ vice parameter name spaces.
ENVIRONMENT
MAIL_CONFIG
@@ -299,7 +299,8 @@ POSTCONF(1) POSTCONF(1)
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
DATABASE_README, Postfix lookup table overview
diff --git a/postfix/man/man1/postconf.1 b/postfix/man/man1/postconf.1
index b86bd9df5..28d35f71b 100644
--- a/postfix/man/man1/postconf.1
+++ b/postfix/man/man1/postconf.1
@@ -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
diff --git a/postfix/man/man8/master.8 b/postfix/man/man8/master.8
index 9bb63f346..0953cce38 100644
--- a/postfix/man/man8/master.8
+++ b/postfix/man/man8/master.8
@@ -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
diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h
index e0be76baa..47907172b 100644
--- a/postfix/src/global/mail_version.h
+++ b/postfix/src/global/mail_version.h
@@ -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
diff --git a/postfix/src/master/master.c b/postfix/src/master/master.c
index cc41e57d9..cef01e401 100644
--- a/postfix/src/master/master.c
+++ b/postfix/src/master/master.c
@@ -150,7 +150,7 @@
/* 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
diff --git a/postfix/src/postconf/Makefile.in b/postfix/src/postconf/Makefile.in
index 64b4b823e..eec7626a8 100644
--- a/postfix/src/postconf/Makefile.in
+++ b/postfix/src/postconf/Makefile.in
@@ -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
diff --git a/postfix/src/postconf/postconf.c b/postfix/src/postconf/postconf.c
index e22f63e4f..cbc079be1 100644
--- a/postfix/src/postconf/postconf.c
+++ b/postfix/src/postconf/postconf.c
@@ -219,10 +219,10 @@
/* 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
@@ -245,7 +245,8 @@
/* /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
index 000000000..bb1c81e10
--- /dev/null
+++ b/postfix/src/postconf/test6.ref
@@ -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
index 000000000..1bd731b97
--- /dev/null
+++ b/postfix/src/postconf/test7.ref
@@ -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
index 000000000..af47b44ba
--- /dev/null
+++ b/postfix/src/postconf/test8.ref
@@ -0,0 +1 @@
+whatevershebrings_time_limit = 1
diff --git a/postfix/src/smtpstone/smtp-sink.c b/postfix/src/smtpstone/smtp-sink.c
index bcdbefdc0..46eae5c5d 100644
--- a/postfix/src/smtpstone/smtp-sink.c
+++ b/postfix/src/smtpstone/smtp-sink.c
@@ -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 replycodeoptional-text */
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 .");
- 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, '?')));
diff --git a/postfix/src/util/inet_proto.c b/postfix/src/util/inet_proto.c
index c0ad50675..fd082ed07 100644
--- a/postfix/src/util/inet_proto.c
+++ b/postfix/src/util/inet_proto.c
@@ -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 */
diff --git a/postfix/src/xsasl/xsasl_dovecot_server.c b/postfix/src/xsasl/xsasl_dovecot_server.c
index be7f82249..6c75dc9c1 100644
--- a/postfix/src/xsasl/xsasl_dovecot_server.c
+++ b/postfix/src/xsasl/xsasl_dovecot_server.c
@@ -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;