summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/mta.c
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2010-10-29 09:16:09 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2010-10-29 09:16:09 +0000
commit7e76f02782ab7976338844f864eef0659b6e5393 (patch)
treebc9ef868b80c0064dce46f04de870680dc036365 /usr.sbin/smtpd/mta.c
parent3bbbe5b8ce319e42892d378b832ec4eb444528c1 (diff)
smtpd no longer knows a map called "secrets" which holds credentials for
authenticated relaying. one can create many maps holding credentials and name them however he/she wants, just like any other map. teach smtpd how to select a credentials map at the rule-level allowing a setup to relay through the same MX with different credentials depending on the source. smtpd.conf.5 updated to reflect changes with help from jmc@
Diffstat (limited to 'usr.sbin/smtpd/mta.c')
-rw-r--r--usr.sbin/smtpd/mta.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/mta.c b/usr.sbin/smtpd/mta.c
index b9119a80c91..58248b8a73a 100644
--- a/usr.sbin/smtpd/mta.c
+++ b/usr.sbin/smtpd/mta.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mta.c,v 1.93 2010/10/09 22:05:35 gilles Exp $ */
+/* $OpenBSD: mta.c,v 1.94 2010/10/29 09:16:07 gilles Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -103,8 +103,10 @@ mta_imsg(struct smtpd *env, struct imsgev *iev, struct imsg *imsg)
/* use auth? */
if ((b->rule.r_value.relayhost.flags & F_SSL) &&
- (b->rule.r_value.relayhost.flags & F_AUTH))
+ (b->rule.r_value.relayhost.flags & F_AUTH)) {
s->flags |= MTA_USE_AUTH;
+ s->secmapid = b->rule.r_value.relayhost.secmapid;
+ }
/* force a particular SSL mode? */
switch (b->rule.r_value.relayhost.flags & F_SSL) {
@@ -352,6 +354,7 @@ mta_enter_state(struct mta_session *s, int newstate, void *p)
*/
bzero(&secret, sizeof(secret));
secret.id = s->id;
+ secret.secmapid = s->secmapid;
strlcpy(secret.host, s->host, sizeof(secret.host));
imsg_compose_event(s->env->sc_ievs[PROC_LKA], IMSG_LKA_SECRET,
0, 0, -1, &secret, sizeof(secret));