Claus Aßmann wrote:
> Marcus wrote:
>> Sorry, didn't seen the post "dh key too small error" ... so the only workaround is to mark
>> broken servers to access in set Try_TLS, right?
>
> I've posted a link to a feature (patch) in that thread, give it a try.
> Here it is again:
>
http://www.sendmail.org/%7Eca/email/patches/tls_failures.p1
>
> and the desciption:
>
> tls_failures If enabled, the MTA will stop using STARTTLS on
> outbound connections after a certain number of previous
> failures with either PROTOCOL or SOFTWARE error. An
> optional numeric value indicates the number of attempts
> after which the MTA will give up trying STARTTLS:
>
> FEATURE(`tls_failures', `8')
>
> Once ${ntries} exceeds the value of 8, and if the
> previous delivery ended up with a PROTOCOL or
> SOFTWARE TLS errors, then the MTA will not use
> STARTTLS. Default value for the parameter is 5.
>
> Note: if you enforce TLS for the recipient or
> destination then it is likely the message will
> never be delivered as the TLS enforced criterias
> are unlikely to be ever verified.
Thank you Claus for this patch.
I used your idea and code to implement this functionality on a
debian 8.2 (jessie) system with stock debian sendmail packages
(version 8.14.4-8) installed.
Putting the following code at the very end of
sendmail.mc and
rebuilding
sendmail.cf does the job.
divert(-1)
# Stop using STARTTLS on outbound connections after a certain number of
# previous failures with either PROTOCOL or SOFTWARE error.
# This code is based on a patch from Claus Assmann against
# sendmail-8.15.2 that implements a new feature "tls_failures".
# See: http://
http://www.sendmail.org/~ca/email/patches/tls_failures.p1
#
# The following copyright notice applies to the borrowed idea and code:
#
# Copyright (c) 2015 Proofpoint, Inc. and its suppliers.
# All rights reserved.
#
# By using this file, you agree to the terms and conditions set
# forth in the LICENSE file which can be found at the top level of
# the sendmail distribution.
#
define(`_NEED_MACRO_MAP_', `1')dnl
define(`TLS_FAILURES_CNT',`3')dnl # Stop using STARTTLS after 3 failures
LOCAL_CONFIG
C{persistentMacros}{saved_verify}
LOCAL_TRY_TLS
R$* $: $&{saved_verify} $| $(arith l $@ eval(TLS_FAILURES_CNT - 1) $@ $&{ntries} $)
RSOFTWARE $| TRUE $#error $@ 5.7.1 $: "550 do not try TLS with " $&{server_name} " ["$&{server_addr}"] due to previous verify=SOFTWARE errors"
RPROTOCOL $| TRUE $#error $@ 5.7.1 $: "550 do not try TLS with " $&{server_name} " ["$&{server_addr}"] due to previous verify=PROTOCOL errors"
R$* $@ OK
LOCAL_TLS_SERVER
R$* $: $(macro {saved_verify} $@ $1 $) $1
R$* $@ OK
Regards,
Kees.
--
Kees Theunissen.