--- courier-0.58.0/courier/module.esmtp/smtproutes.h.reqtls 2007-12-05 14:10:55.000000000 -0800 +++ courier-0.58.0/courier/module.esmtp/smtproutes.h 2007-12-05 14:11:21.000000000 -0800 @@ -14,5 +14,6 @@ #define ROUTE_STARTTLS 1 #define ROUTE_NOSECURITY 2 +#define ROUTE_REQTLS 4 #endif --- courier-0.58.0/courier/module.esmtp/smtproutes.c.reqtls 2001-11-03 07:23:20.000000000 -0800 +++ courier-0.58.0/courier/module.esmtp/smtproutes.c 2007-12-05 14:10:35.000000000 -0800 @@ -135,6 +135,9 @@ for (r=q; *r; r++) *r=(int)(unsigned char)toupper(*r); + if (strcmp(q, "SECURITY=REQTLS") == 0) + *flags |= ROUTE_REQTLS; + if (strcmp(q, "SECURITY=STARTTLS") == 0) *flags |= ROUTE_STARTTLS; --- courier-0.58.0/courier/module.esmtp/esmtpclient.c.reqtls 2007-12-05 14:11:33.000000000 -0800 +++ courier-0.58.0/courier/module.esmtp/esmtpclient.c 2007-12-05 14:16:31.000000000 -0800 @@ -276,6 +276,9 @@ if (smtproutes_flags & ROUTE_STARTTLS) return ("STARTTLS"); + if (smtproutes_flags & ROUTE_REQTLS) + return ("REQTLS"); + sec=ctlfile_security(ctf); if (!sec) @@ -1374,17 +1377,28 @@ if ((p=want_security(ctf)) != 0) { + if ( strcmp(p, "REQTLS") == 0) + { + if (hasstarttls || using_tls) + return (0); + + talking(del, ctf); + sent(del, ctf, "STARTTLS REQUESTED FOR THIS MESSAGE"); + smtp_msg(del, ctf); + smtp_error(del, ctf, + "500 Unable to set minimum security level."); + } if ( strcmp(p, "STARTTLS") == 0) { if ((hasstarttls || using_tls) && hassecurity_starttls) return (0); - } - talking(del, ctf); - sent(del, ctf, "SECURITY=STARTTLS REQUESTED FOR THIS MESSAGE"); - smtp_msg(del, ctf); - smtp_error(del, ctf, - "500 Unable to set minimum security level."); + talking(del, ctf); + sent(del, ctf, "SECURITY=STARTTLS REQUESTED FOR THIS MESSAGE"); + smtp_msg(del, ctf); + smtp_error(del, ctf, + "500 Unable to set minimum security level."); + } quit(); return (-1); }