summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/mfa.c
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2009-04-28 23:11:26 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2009-04-28 23:11:26 +0000
commit0a19febb866a03a225d381dc1c1f72ac190b1275 (patch)
tree3b73ef8e7f8794d4f0d03895c13b8575b5e80aa1 /usr.sbin/smtpd/mfa.c
parent01edd61facb96cf511fecaf6372cb462a0db6f3c (diff)
smtp auth happened to work by luck because delivery to mbox action was the
first action of an enum and we allocated a struct using calloc, but we did not properly initialize the action for authenticated users. while at it, change the name of path action flags so that we know at first sight that they are path related. this diff fixes the immediate issue but still needs work. ok jacekm@, "we'll work out a long term solution"
Diffstat (limited to 'usr.sbin/smtpd/mfa.c')
-rw-r--r--usr.sbin/smtpd/mfa.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/mfa.c b/usr.sbin/smtpd/mfa.c
index 5c1ba121714..4e3665c86cc 100644
--- a/usr.sbin/smtpd/mfa.c
+++ b/usr.sbin/smtpd/mfa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfa.c,v 1.23 2009/04/28 21:27:25 jacekm Exp $ */
+/* $OpenBSD: mfa.c,v 1.24 2009/04/28 23:11:25 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -428,7 +428,7 @@ mfa_test_rcpt(struct smtpd *env, struct message *m)
goto refuse;
if (ss.flags & F_MESSAGE_AUTHENTICATED)
- goto accept;
+ ss.u.path.flags |= F_PATH_AUTHENTICATED;
if (mfa_ruletest_rcpt(env, &ss.u.path, &ss.ss))
goto accept;
@@ -453,7 +453,8 @@ mfa_ruletest_rcpt(struct smtpd *env, struct path *path, struct sockaddr_storage
struct mapel *me;
TAILQ_FOREACH(r, env->sc_rules, r_entry) {
- if (! mfa_check_source(r->r_sources, ss))
+ if (!(path->flags & F_PATH_AUTHENTICATED) &&
+ ! mfa_check_source(r->r_sources, ss))
continue;
TAILQ_FOREACH(cond, &r->r_conditions, c_entry) {