summaryrefslogtreecommitdiff
path: root/gnu/dist/postfix/src
diff options
context:
space:
mode:
authorheas <heas@NetBSD.org>2004-07-28 23:19:42 +0000
committerheas <heas@NetBSD.org>2004-07-28 23:19:42 +0000
commitc5f2fcaa9d709bb01db87be0106e3e7262d38f57 (patch)
tree274f2794afe473b5a29394536eaddd85ba020100 /gnu/dist/postfix/src
parent6bb314b03ed3d7d3c91be7bbd2c6a56c1124adac (diff)
Resolve conflicts
Diffstat (limited to 'gnu/dist/postfix/src')
-rw-r--r--gnu/dist/postfix/src/global/mynetworks.c13
-rw-r--r--gnu/dist/postfix/src/qmgr/qmgr_message.c33
-rw-r--r--gnu/dist/postfix/src/smtp/smtp_connect.c18
-rw-r--r--gnu/dist/postfix/src/smtpd/smtpd.c21
-rw-r--r--gnu/dist/postfix/src/util/sys_defs.h10
5 files changed, 65 insertions, 30 deletions
diff --git a/gnu/dist/postfix/src/global/mynetworks.c b/gnu/dist/postfix/src/global/mynetworks.c
index e227e9ee09b..1c9fd2983df 100644
--- a/gnu/dist/postfix/src/global/mynetworks.c
+++ b/gnu/dist/postfix/src/global/mynetworks.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mynetworks.c,v 1.4 2004/05/31 00:46:47 heas Exp $ */
+/* $NetBSD: mynetworks.c,v 1.5 2004/07/28 23:19:42 heas Exp $ */
/*++
/* NAME
@@ -93,6 +93,17 @@ const char *mynetworks(void)
mask_style = name_mask("mynetworks mask style", mask_styles,
var_mynetworks_style);
+ /*
+ * XXX Workaround: name_mask() needs a flags argument so that we can
+ * require exactly one value, or we need to provide an API that is
+ * dedicated for single-valued flags.
+ */
+ for (i = 0, junk = mask_style; junk != 0; junk >>= 1)
+ i += (junk & 1);
+ if (i != 1)
+ msg_fatal("bad %s value: %s; specify exactly one value",
+ VAR_MYNETWORKS_STYLE, var_mynetworks_style);
+
result = vstring_alloc(20);
my_addr_list = own_inet_addr_list();
my_mask_list = own_inet_mask_list();
diff --git a/gnu/dist/postfix/src/qmgr/qmgr_message.c b/gnu/dist/postfix/src/qmgr/qmgr_message.c
index 87f10f76244..91fb001a886 100644
--- a/gnu/dist/postfix/src/qmgr/qmgr_message.c
+++ b/gnu/dist/postfix/src/qmgr/qmgr_message.c
@@ -1,4 +1,4 @@
-/* $NetBSD: qmgr_message.c,v 1.11 2004/05/31 00:46:48 heas Exp $ */
+/* $NetBSD: qmgr_message.c,v 1.12 2004/07/28 23:19:42 heas Exp $ */
/*++
/* NAME
@@ -982,10 +982,9 @@ static void qmgr_message_resolve(QMGR_MESSAGE *message)
* agent resources. We use recipient@nexthop as queue name rather
* than the actual recipient domain name, so that one recipient in
* multiple equivalent domains cannot evade the per-recipient
- * concurrency limit. XXX Should split the address on the recipient
- * delimiter if one is defined, but doing a proper job requires
- * knowledge of local aliases. Yuck! I don't want to duplicate
- * delivery-agent specific knowledge in the queue manager.
+ * concurrency limit. Split the address on the recipient delimiter if
+ * one is defined, so that extended addresses don't get extra
+ * delivery slots.
*
* Fold the result to lower case so that we don't have multiple queues
* for the same name.
@@ -993,18 +992,32 @@ static void qmgr_message_resolve(QMGR_MESSAGE *message)
* Important! All recipients in a queue must have the same nexthop
* value. It is OK to have multiple queues with the same nexthop
* value, but only when those queues are named after recipients.
+ *
+ * The single-recipient code below was written for local(8) like
+ * delivery agents, and assumes that all domains that deliver to the
+ * same (transport + nexthop) are aliases for $nexthop. Delivery
+ * concurrency is changed from per-domain into per-recipient, by
+ * changing the queue name from nexthop into localpart@nexthop.
+ *
+ * XXX This assumption is incorrect when different destinations share
+ * the same (transport + nexthop). In reality, such transports are
+ * rarely configured to use single-recipient deliveries. The fix is
+ * to decouple the per-destination recipient limit from the
+ * per-destination concurrency.
*/
vstring_strcpy(queue_name, STR(reply.nexthop));
if (strcmp(transport->name, MAIL_SERVICE_ERROR) != 0
&& transport->recipient_limit == 1) {
+ /* Copy the recipient localpart. */
at = strrchr(STR(reply.recipient), '@');
len = (at ? (at - STR(reply.recipient))
: strlen(STR(reply.recipient)));
- VSTRING_SPACE(queue_name, len + 2);
- memmove(STR(queue_name) + len + 1, STR(queue_name),
- LEN(queue_name) + 1);
- memcpy(STR(queue_name), STR(reply.recipient), len);
- STR(queue_name)[len] = '@';
+ vstring_strncpy(queue_name, STR(reply.recipient), len);
+ /* Remove the address extension from the recipient localpart. */
+ if (*var_rcpt_delim && split_addr(STR(queue_name), *var_rcpt_delim))
+ vstring_truncate(queue_name, strlen(STR(queue_name)));
+ /* Assume the recipient domain is equivalent to nexthop. */
+ vstring_sprintf_append(queue_name, "@%s", STR(reply.nexthop));
}
lowercase(STR(queue_name));
diff --git a/gnu/dist/postfix/src/smtp/smtp_connect.c b/gnu/dist/postfix/src/smtp/smtp_connect.c
index 6fa000b80c6..026fa7458f1 100644
--- a/gnu/dist/postfix/src/smtp/smtp_connect.c
+++ b/gnu/dist/postfix/src/smtp/smtp_connect.c
@@ -1,4 +1,4 @@
-/* $NetBSD: smtp_connect.c,v 1.11 2004/05/31 00:46:48 heas Exp $ */
+/* $NetBSD: smtp_connect.c,v 1.12 2004/07/28 23:19:42 heas Exp $ */
/*++
/* NAME
@@ -351,6 +351,7 @@ int smtp_connect(SMTP_STATE *state)
if (++addr_count == var_smtp_mxaddr_limit)
next = 0;
if ((state->session = smtp_connect_addr(addr, port, why)) != 0) {
+ state->features = 0; /* XXX should be SESSION info */
if (++sess_count == var_smtp_mxsess_limit)
next = 0;
state->final_server = (cpp[1] == 0 && next == 0);
@@ -358,13 +359,20 @@ int smtp_connect(SMTP_STATE *state)
debug_peer_check(state->session->host, state->session->addr);
if (smtp_helo(state, misc_flags) == 0)
smtp_xfer(state);
- if (state->history != 0
- && (state->error_mask & name_mask(VAR_NOTIFY_CLASSES,
- mail_error_masks, var_notify_classes)))
- smtp_chat_notify(state);
+ if (state->history != 0) {
+ if (state->error_mask & name_mask(VAR_NOTIFY_CLASSES,
+ mail_error_masks, var_notify_classes))
+ smtp_chat_notify(state);
+ smtp_chat_reset(state);
+ }
+ state->error_mask = 0;
+ state->size_limit = 0;
/* XXX smtp_xfer() may abort in the middle of DATA. */
smtp_session_free(state->session);
state->session = 0;
+#ifdef USE_SASL_AUTH
+ smtp_sasl_cleanup(state);
+#endif
debug_peer_restore();
smtp_rcpt_cleanup(state);
} else {
diff --git a/gnu/dist/postfix/src/smtpd/smtpd.c b/gnu/dist/postfix/src/smtpd/smtpd.c
index d812c61060a..0270506a74d 100644
--- a/gnu/dist/postfix/src/smtpd/smtpd.c
+++ b/gnu/dist/postfix/src/smtpd/smtpd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: smtpd.c,v 1.10 2004/05/31 00:46:48 heas Exp $ */
+/* $NetBSD: smtpd.c,v 1.11 2004/07/28 23:19:42 heas Exp $ */
/*++
/* NAME
@@ -340,6 +340,8 @@
/* The number of junk commands (NOOP, VRFY, ETRN or RSET) that a remote
/* SMTP client can send before the Postfix SMTP server starts to
/* increment the error counter with each junk command.
+/* .PP
+/* Available in Postfix version 2.1 and later:
/* .IP "\fBsmtpd_recipient_overshoot_limit (1000)\fR"
/* The number of recipients that a remote SMTP client can send in
/* excess of the limit specified with $smtpd_recipient_limit, before
@@ -351,9 +353,6 @@
/* As of version 2.1, Postfix can be configured to delegate access
/* policy decisions to an external server that runs outside Postfix.
/* See the file SMTPD_POLICY_README for more information.
-/* .IP "\fBsmtpd_policy_service_timeout (100s)\fR"
-/* The time limit for connecting to, writing to or receiving from a
-/* delegated SMTPD policy server.
/* .IP "\fBsmtpd_policy_service_max_idle (300s)\fR"
/* The time after which an idle SMTPD policy service connection is
/* closed.
@@ -426,7 +425,7 @@
/* SENDER AND RECIPIENT ADDRESS VERIFICATION CONTROLS
/* .ad
/* .fi
-/* Postfix version 2.1 introduces sender and address verification.
+/* Postfix version 2.1 introduces sender and recipient address verification.
/* This feature is implemented by sending probe email messages that
/* are not actually delivered.
/* This feature is requested via the reject_unverified_sender and
@@ -537,7 +536,7 @@
/* The list of "trusted" SMTP clients that have more privileges than
/* "strangers".
/* .IP "\fBmyorigin ($myhostname)\fR"
-/* The default domain name that locally-posted mail appears to come
+/* The domain name that locally-posted mail appears to come
/* from, and that locally posted mail is delivered to.
/* .IP "\fBprocess_id (read-only)\fR"
/* The process ID of a Postfix command or daemon process.
@@ -814,6 +813,11 @@ static void mail_reset(SMTPD_STATE *);
static void rcpt_reset(SMTPD_STATE *);
static void chat_reset(SMTPD_STATE *, int);
+ /*
+ * This filter is applied after printable().
+ */
+#define NEUTER_CHARACTERS " <>()\\\";:@"
+
#ifdef USE_SASL_AUTH
/*
@@ -885,7 +889,7 @@ static int helo_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
mail_reset(state);
rcpt_reset(state);
state->helo_name = mystrdup(printable(argv[1].strval, '?'));
- neuter(state->helo_name, "<>()\\\";:@", '?');
+ neuter(state->helo_name, NEUTER_CHARACTERS, '?');
/* Downgrading the protocol name breaks the unauthorized pipelining test. */
if (strcasecmp(state->protocol, MAIL_PROTO_ESMTP) != 0
&& strcasecmp(state->protocol, MAIL_PROTO_SMTP) != 0) {
@@ -926,7 +930,7 @@ static int ehlo_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
mail_reset(state);
rcpt_reset(state);
state->helo_name = mystrdup(printable(argv[1].strval, '?'));
- neuter(state->helo_name, "<>()\\\";:@", '?');
+ neuter(state->helo_name, NEUTER_CHARACTERS, '?');
if (strcasecmp(state->protocol, MAIL_PROTO_ESMTP) != 0) {
myfree(state->protocol);
state->protocol = mystrdup(MAIL_PROTO_ESMTP);
@@ -2015,7 +2019,6 @@ static int xclient_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
if (s) myfree(s); \
s = (v) ? mystrdup(v) : 0; \
} while(0)
-#define NEUTER_CHARACTERS "<>()\\\";:@"
/*
* Iterate over all attribute=value elements.
diff --git a/gnu/dist/postfix/src/util/sys_defs.h b/gnu/dist/postfix/src/util/sys_defs.h
index 278f664ca0d..4cf15f9b2f0 100644
--- a/gnu/dist/postfix/src/util/sys_defs.h
+++ b/gnu/dist/postfix/src/util/sys_defs.h
@@ -1,4 +1,4 @@
-/* $NetBSD: sys_defs.h,v 1.13 2004/05/31 03:55:20 heas Exp $ */
+/* $NetBSD: sys_defs.h,v 1.14 2004/07/28 23:19:42 heas Exp $ */
#ifndef _SYS_DEFS_H_INCLUDED_
#define _SYS_DEFS_H_INCLUDED_
@@ -53,11 +53,11 @@
#define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
#define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin"
#if (defined(__NetBSD_Version__) && __NetBSD_Version__ > 200040000)
-#define USE_STATVFS
-#define STATVFS_IN_SYS_STATVFS_H
+# define USE_STATVFS
+# define STATVFS_IN_SYS_STATVFS_H
#else
-#define USE_STATFS
-#define STATFS_IN_SYS_MOUNT_H
+# define USE_STATFS
+# define STATFS_IN_SYS_MOUNT_H
#endif
#define HAS_POSIX_REGEXP
#define HAS_ST_GEN /* struct stat contains inode generation number */