summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/lka_session.c
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2011-05-16 21:42:04 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2011-05-16 21:42:04 +0000
commit9bc6aa0c5e6a7a7a9b3a7a66269ccf5e323d23f2 (patch)
treede39a445b662b1923f3980dc2bb7bcea518e41eb /usr.sbin/smtpd/lka_session.c
parent17a72b995af7c21717251f1a78b0d8972add486d (diff)
when a C_VDOM recipient expands to a local user, envelope expansion will
reprocess the envelope. since the original condition we matched is still C_VDOM, it triggers an expansion loop causing recipient to be rejected. this *should* fix the issue experienced by armani@, it does on my laptop.
Diffstat (limited to 'usr.sbin/smtpd/lka_session.c')
-rw-r--r--usr.sbin/smtpd/lka_session.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/lka_session.c b/usr.sbin/smtpd/lka_session.c
index c2ff1ff5eef..f93adff8b71 100644
--- a/usr.sbin/smtpd/lka_session.c
+++ b/usr.sbin/smtpd/lka_session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lka_session.c,v 1.1 2011/05/16 21:05:51 gilles Exp $ */
+/* $OpenBSD: lka_session.c,v 1.2 2011/05/16 21:42:03 gilles Exp $ */
/*
* Copyright (c) 2011 Gilles Chehade <gilles@openbsd.org>
@@ -425,6 +425,16 @@ lka_session_resolve_node(struct envelope *ep, struct expandnode *xn)
dlv->type = D_MDA;
dlv->agent.mda.to = xn->u;
+ /* overwrite the initial condition before we expand the
+ * envelope again. if we came from a C_VDOM, not doing
+ * so would lead to a VDOM loop causing recipient to be
+ * rejected.
+ *
+ * i'll find a more elegant solution later, for now it
+ * fixes an annoying bug.
+ */
+ ep->rule.r_condition.c_type = C_DOM;
+
/* if expansion of a user results in same user ... deliver */
if (strcmp(xn->u.user, xn->as_user) == 0)
break;