diff options
author | gshapiro <gshapiro@FreeBSD.org> | 2013-04-21 17:08:44 +0000 |
---|---|---|
committer | gshapiro <gshapiro@FreeBSD.org> | 2013-04-21 17:08:44 +0000 |
commit | 891f1b61da33280fa1ba153569b360771d27e984 (patch) | |
tree | ab52d50bcac2932bf5e37126b12ef0d2886488f1 /contrib/sendmail/src/srvrsmtp.c | |
parent | 84dd41acc62e69379821ee9ff4d6461233543f07 (diff) | |
parent | a03b7e14eaaeb30fff6859c589152c8787d230e3 (diff) | |
download | FreeBSD-src-891f1b61da33280fa1ba153569b360771d27e984.zip FreeBSD-src-891f1b61da33280fa1ba153569b360771d27e984.tar.gz |
Merge sendmail 8.14.7 to HEAD
MFC after: 4 days
Diffstat (limited to 'contrib/sendmail/src/srvrsmtp.c')
-rw-r--r-- | contrib/sendmail/src/srvrsmtp.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/contrib/sendmail/src/srvrsmtp.c b/contrib/sendmail/src/srvrsmtp.c index c4c045b..0dfdf6b 100644 --- a/contrib/sendmail/src/srvrsmtp.c +++ b/contrib/sendmail/src/srvrsmtp.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2010, 2012 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2010, 2012, 2013 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -17,7 +17,7 @@ # include <libmilter/mfdef.h> #endif /* MILTER */ -SM_RCSID("@(#)$Id: srvrsmtp.c,v 8.1011 2012/12/19 02:49:21 ca Exp $") +SM_RCSID("@(#)$Id: srvrsmtp.c,v 8.1015 2013/03/12 15:24:54 ca Exp $") #include <sm/time.h> #include <sm/fdset.h> @@ -1864,7 +1864,7 @@ smtp(nullserver, d_flags, e) { message("454 4.3.3 TLS not available: error generating SSL handle"); if (LogLevel > 8) - tlslogerr("server"); + tlslogerr(LOG_WARNING, "server"); goto tls_done; } @@ -1927,7 +1927,7 @@ smtp(nullserver, d_flags, e) ssl_err, errno, i, CurSmtpClient); if (LogLevel > 9) - tlslogerr("server"); + tlslogerr(LOG_WARNING, "server"); } tls_ok_srv = false; SSL_free(srv_ssl); @@ -4518,6 +4518,8 @@ rcpt_esmtp_args(a, kp, vp, e) } else if (sm_strcasecmp(kp, "orcpt") == 0) { + char *p; + if (!bitset(SRV_OFFER_DSN, e->e_features)) { usrerr("504 5.7.0 Sorry, ORCPT not supported, we do not allow DSN"); @@ -4528,16 +4530,25 @@ rcpt_esmtp_args(a, kp, vp, e) usrerr("501 5.5.2 ORCPT requires a value"); /* NOTREACHED */ } - if (strchr(vp, ';') == NULL || !xtextok(vp)) + if (a->q_orcpt != NULL) + { + usrerr("501 5.5.0 Duplicate ORCPT parameter"); + /* NOTREACHED */ + } + p = strchr(vp, ';'); + if (p == NULL) { usrerr("501 5.5.4 Syntax error in ORCPT parameter value"); /* NOTREACHED */ } - if (a->q_orcpt != NULL) + *p = '\0'; + if (!isatom(vp) || !xtextok(p + 1)) { - usrerr("501 5.5.0 Duplicate ORCPT parameter"); + *p = ';'; + usrerr("501 5.5.4 Syntax error in ORCPT parameter value"); /* NOTREACHED */ } + *p = ';'; a->q_orcpt = sm_rpool_strdup_x(e->e_rpool, vp); } else @@ -4923,7 +4934,7 @@ help(topic, e) len = strlen(topic); - while (sm_io_fgets(hf, SM_TIME_DEFAULT, buf, sizeof(buf)) != NULL) + while (sm_io_fgets(hf, SM_TIME_DEFAULT, buf, sizeof(buf)) >= 0) { if (buf[0] == '#') { |