summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/lka.c
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2009-10-07 18:09:13 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2009-10-07 18:09:13 +0000
commit0bd78cb0adb577d00248762e6f5f78cb75047c48 (patch)
tree0c04a835617ce90af2b9aff1d62990eb09aa9412 /usr.sbin/smtpd/lka.c
parent622768b2cd479ad6bfdbf3d62078732df052ba87 (diff)
currently both mfa and lka perform ruleset matching for their own purposes.
make lka the only caller of ruleset_match(), mfa request match through imsg which will shrink its code and help me implement virtual domains properly. idea discussed with jacekm@
Diffstat (limited to 'usr.sbin/smtpd/lka.c')
-rw-r--r--usr.sbin/smtpd/lka.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/lka.c b/usr.sbin/smtpd/lka.c
index 10214e0480f..a561a91b80e 100644
--- a/usr.sbin/smtpd/lka.c
+++ b/usr.sbin/smtpd/lka.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lka.c,v 1.64 2009/10/07 17:30:41 gilles Exp $ */
+/* $OpenBSD: lka.c,v 1.65 2009/10/07 18:09:12 gilles Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -344,6 +344,25 @@ lka_dispatch_mfa(int sig, short event, void *p)
break;
}
+ case IMSG_LKA_RULEMATCH: {
+ struct submit_status *ss = imsg.data;
+ struct rule *r;
+
+ IMSG_SIZE_CHECK(ss);
+
+ ss->code = 530;
+
+ r = ruleset_match(env, &ss->u.path, &ss->ss);
+ if (r != NULL) {
+ ss->code = 250;
+ ss->u.path.rule = *r;
+ }
+
+ imsg_compose_event(env->sc_ievs[PROC_MFA], IMSG_LKA_RULEMATCH, 0, 0, -1,
+ ss, sizeof(*ss));
+
+ break;
+ }
case IMSG_LKA_RCPT: {
struct submit_status *ss = imsg.data;
struct message message;