diff options
author | Eric Faurot <eric@cvs.openbsd.org> | 2012-08-21 20:19:47 +0000 |
---|---|---|
committer | Eric Faurot <eric@cvs.openbsd.org> | 2012-08-21 20:19:47 +0000 |
commit | 567cbc2bb44ed7a2c477b0787d4ccd50e8ebecf2 (patch) | |
tree | 8e02dd4f4d744ae5e98f189efaab025969f857a8 /usr.sbin/smtpd/lka_session.c | |
parent | aeaaf85fa9a03d459d328e8f93992b1f1d1043b4 (diff) |
Allow smtpd to work as a backup MX, relaying only to MXs with higher
priority in the DNS record. For example:
accept for domain "foo.org" relay backup "mx3.foo.org"
will relay mails for "foo.org" using only hosts with higher priority
(i.e. lower value) than "mx3.foo.org", which is supposed to be the
current server.
If the specified backup MX is not found in the DNS record, relaying
works as normal.
ok gilles@
Diffstat (limited to 'usr.sbin/smtpd/lka_session.c')
-rw-r--r-- | usr.sbin/smtpd/lka_session.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/lka_session.c b/usr.sbin/smtpd/lka_session.c index 3037c15cbce..6b75d5bbe16 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.21 2012/08/19 14:16:58 chl Exp $ */ +/* $OpenBSD: lka_session.c,v 1.22 2012/08/21 20:19:46 eric Exp $ */ /* * Copyright (c) 2011 Gilles Chehade <gilles@openbsd.org> @@ -401,8 +401,7 @@ lka_session_deliver(struct lka_session *lks, struct envelope *ep) } } else if (new_ep->type == D_MTA) { - if (ep->rule.r_action == A_RELAYVIA) - new_ep->agent.mta.relay = ep->rule.r_value.relayhost; + new_ep->agent.mta.relay = ep->rule.r_value.relayhost; if (ep->rule.r_as) { if (ep->rule.r_as->user[0]) { strlcpy(new_ep->sender.user, |