summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2009-03-18 00:07:42 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2009-03-18 00:07:42 +0000
commit40aaf15bf028d145fb613af673e474bee71d23ef (patch)
tree299caa658afae193748725d5a8dcde0480e41db1 /usr.sbin
parentef49250b53fefa64ee392ac3cf7e1ef507b06e8d (diff)
in mta, when remote host advertises AUTH, do not attempt to authenticate
unless we do have F_AUTH set on the mxhost (which means we explicitely mentionned authentication in config) and we did find credentials in the secrets map. issue and initial diff from Rivo Nurges <rix@estpak.ee>
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/smtpd/mta.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/mta.c b/usr.sbin/smtpd/mta.c
index 480e37dd2f7..4632592375f 100644
--- a/usr.sbin/smtpd/mta.c
+++ b/usr.sbin/smtpd/mta.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mta.c,v 1.35 2009/03/15 19:15:25 gilles Exp $ */
+/* $OpenBSD: mta.c,v 1.36 2009/03/18 00:07:41 gilles Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -696,9 +696,12 @@ mta_reply_handler(struct bufferevent *bev, void *arg)
if (sessionp->s_state == S_GREETED &&
(sessionp->s_flags & F_PEERHASAUTH) &&
- (sessionp->s_flags & F_SECURE)) {
+ (sessionp->s_flags & F_SECURE) &&
+ (mxhost->flags & F_AUTH) &&
+ (mxhost->credentials[0] != '\0')) {
log_debug("AUTH PLAIN %s", mxhost->credentials);
- session_respond(sessionp, "AUTH PLAIN %s", mxhost->credentials);
+ session_respond(sessionp, "AUTH PLAIN %s",
+ mxhost->credentials);
sessionp->s_state = S_AUTH_INIT;
return 0;
}