Why does Postfix show TLS handshake failure when connecting to an Exchange server?

Summary

Postfix TLS handshake failures with Exchange servers are often due to a combination of certificate issues (invalid, untrusted, or expired), protocol/cipher suite incompatibilities, network configuration problems, and outdated configurations. Key areas to investigate include certificate validity, TLS version support (TLS 1.2+), cipher suite matching, firewall rules, DNS and SNI settings, CRL access, MTU size, and OpenSSL restrictions. Diagnostic tools like `openssl s_client` and SSL Labs can help pinpoint the specific cause.

Key findings

  • Certificate Problems: Invalid, untrusted, or expired certificates on the Exchange server can cause the Postfix client to reject the connection.
  • Protocol/Cipher Mismatch: Incompatible TLS versions or cipher suites between Postfix and Exchange will prevent a successful handshake.
  • Network Configuration: Firewalls blocking TLS ports (465, 587, 993, 995), incorrect DNS configuration, and SNI issues can disrupt the TLS handshake.
  • CRL Access: If the Postfix server cannot access the CRL distribution points specified in the Exchange certificate, the handshake may fail.
  • MTU Size: MTU size incompatibilities between the Postfix server and the Exchange server's network path can result in TLS handshake failures.
  • Outdated TLS Versions: Using deprecated TLS versions (1.0, 1.1) on the Exchange server results in handshake failures.
  • OpenSSL Restrictions: Restrictions in OpenSSL configuration files can interfere with TLS handshake success.

Key considerations

  • Certificate Validation: Verify the Exchange server's certificate is valid, trusted, and not expired. Ensure DNS is correctly configured for certificate validation.
  • TLS Configuration: Enable compatible TLS versions (1.2 or higher) and strong cipher suites on both Postfix and Exchange. Remove weak or outdated configurations.
  • Firewall Rules: Ensure firewalls are allowing TLS traffic on the necessary ports (465, 587, 993, 995). Check for any rules that might be blocking CRL access.
  • SNI Configuration: If SNI is required, verify it is correctly configured on both the Postfix and Exchange servers.
  • MTU Size Adjustment: Check and adjust the MTU size on the Postfix server's network interface to ensure compatibility with the network path to the Exchange server.
  • Testing Tools: Use tools like `openssl s_client` and SSL Labs to diagnose TLS connection issues and pinpoint the root cause of the handshake failure.
  • Postfix Configuration Review: Carefully review the `smtp_tls_*` and `smtpd_tls_*` parameters in Postfix's configuration.
  • OpenSSL Configuration Check: Check OpenSSL's configuration files for any settings that might restrict TLS versions or cipher suites.

What email marketers say
7Marketer opinions

Postfix TLS handshake failures with Exchange servers often stem from issues related to certificate validation, protocol/cipher suite incompatibility, or network configurations. These include untrusted or expired certificates, DNS misconfigurations, firewall blocking TLS ports, and SNI problems. Older TLS versions, weak cipher suites, and CRL access issues can also lead to failures. MTU size incompatibilities can further complicate matters. Diagnostic tools like `openssl s_client` and SSL Labs can help identify the root cause.

Key opinions

  • Certificate Issues: Untrusted, expired, or revoked certificates on the Exchange server can cause the Postfix client to reject the connection.
  • Protocol/Cipher Mismatch: Incompatible TLS versions or cipher suites between Postfix and Exchange will prevent a successful handshake.
  • Network Configuration: Firewalls blocking TLS ports (465, 587, 993, 995) and incorrect DNS or SNI settings can disrupt the TLS handshake.
  • CRL Access: If the Postfix server cannot access the CRL distribution points specified in the Exchange certificate, the handshake may fail.
  • MTU Size: MTU size incompatibilities between the Postfix server and the Exchange server's network path can result in TLS handshake failures.

Key considerations

  • Certificate Validation: Verify the Exchange server's certificate is valid, trusted, and not expired. Ensure DNS is correctly configured for certificate validation.
  • TLS Configuration: Enable compatible TLS versions (1.2 or higher) and strong cipher suites on both Postfix and Exchange. Remove weak or outdated configurations.
  • Firewall Rules: Ensure firewalls are allowing TLS traffic on the necessary ports (465, 587, 993, 995). Check for any rules that might be blocking CRL access.
  • SNI Configuration: If SNI is required, verify it is correctly configured on both the Postfix and Exchange servers.
  • MTU Size Adjustment: Check and adjust the MTU size on the Postfix server's network interface to ensure compatibility with the network path to the Exchange server.
  • Testing Tools: Use tools like `openssl s_client` and SSL Labs to diagnose TLS connection issues and pinpoint the root cause of the handshake failure.
Marketer view

Email marketer from ServerFault responds that the issue is usually either that your client doesn't trust the certificate presented by the server, or that the cipher suites don't overlap. You can verify the certificate is valid. Also you can force the the client to use less secure settings that overlap more with the server.

December 2022 - ServerFault
Marketer view

Email marketer from Reddit notes that common TLS problems include expired certificates, incorrect DNS configuration preventing certificate validation, firewall blocking TLS ports (465, 587, 993, 995), and SNI (Server Name Indication) issues. Ensure the Exchange server's certificate is valid, DNS is properly configured, firewalls are allowing TLS traffic, and that SNI is correctly configured if required.

May 2023 - Reddit
Marketer view

Email marketer from StackOverflow suggests using `openssl s_client -starttls smtp -connect your.exchangeserver.com:25` to diagnose the TLS connection. This command can help identify certificate issues, protocol negotiation problems, and cipher suite mismatches by providing verbose output of the TLS handshake process.

March 2025 - StackOverflow
Marketer view

Marketer from Email Geeks shares an SSL Labs test link and mentions a possible problem with the TLS chain after the assessment failed with "No secure protocols supported".

April 2024 - Email Geeks
Marketer view

Email marketer from ExpertsExchange responds that problems with Certificate Revocation List (CRL) can sometimes cause handshake issues. Ensure the Postfix server can access the CRL distribution points specified in the Exchange server's certificate. If CRL access is blocked (e.g., by a firewall), the TLS handshake may fail.

April 2021 - ExpertsExchange
Marketer view

Email marketer from EmailSecurity suggests that using weak or outdated encryption protocols or cipher suites can lead to TLS handshake failures. Enable strong ciphers and protocols. Remove any weak or outdated configurations from both Postfix and Exchange.

April 2024 - EmailSecurity.org
Marketer view

Email marketer from LinuxQuestions discusses that Maximum Transmission Unit (MTU) size issues can sometimes cause TLS handshake failures. Check the MTU size on the Postfix server's network interface and ensure it is compatible with the network path to the Exchange server. If necessary, adjust the MTU size to avoid fragmentation.

August 2024 - LinuxQuestions.org

What the experts say
1Expert opinion

Using `openssl s_client` to test TLS connections can help pinpoint the source of TLS handshake failures. This method allows for a detailed examination of certificate validation, protocol negotiation, and cipher suite compatibility between Postfix and Exchange servers.

Key opinions

  • Diagnostic Tool: `openssl s_client` is a valuable tool for diagnosing TLS handshake problems.
  • Troubleshooting Aid: The tool helps identify problems with certificate validation, protocol negotiation, and cipher suite compatibility.

Key considerations

  • Command Usage: Familiarize yourself with the proper syntax and options of `openssl s_client` to effectively test TLS connections.
  • Output Analysis: Learn how to interpret the output of `openssl s_client` to accurately identify the cause of TLS handshake failures.
Expert view

Expert from Word to the Wise recommends using `openssl s_client` to test TLS connections and diagnose issues. She notes this can help pinpoint if the problem is with certificate validation, protocol negotiation, or cipher suite compatibility. This method is useful for troubleshooting TLS handshake failures between Postfix and Exchange servers.

September 2024 - Word to the Wise

What the documentation says
4Technical articles

TLS handshake failures between Postfix and Exchange can arise from certificate issues, protocol mismatches, cipher suite incompatibilities, network disruptions, or outdated configurations. Microsoft Learn, Postfix.org, and OpenSSL.org documentation emphasize the importance of valid certificates, compatible TLS versions and cipher suites, proper network configuration, and up-to-date Exchange Server settings (TLS 1.2 or higher). OpenSSL configuration should also be reviewed for restrictions.

Key findings

  • Certificate Problems: Expired, revoked, or untrusted certificates lead to TLS handshake failures.
  • Protocol/Cipher Incompatibility: Mismatched TLS versions or cipher suites between the client and server cause handshake errors.
  • Network Issues: Network interruptions and firewall blockages hinder the handshake process.
  • Outdated TLS Versions: Using deprecated TLS versions (1.0, 1.1) on the Exchange server results in handshake failures.
  • OpenSSL Restrictions: Restrictions in OpenSSL configuration files can interfere with TLS handshake success.

Key considerations

  • Certificate Validation: Ensure valid certificates, and verify that they are trusted by both systems.
  • TLS Protocol Versions: Use TLS 1.2 or higher on both the Postfix and Exchange servers.
  • Cipher Suite Compatibility: Choose mutually supported and strong cipher suites on both the client and server.
  • Network Connectivity: Verify uninterrupted network connectivity between Postfix and Exchange, and allow traffic on necessary ports.
  • Postfix Configuration: Carefully review the `smtp_tls_*` and `smtpd_tls_*` parameters in Postfix's configuration.
  • OpenSSL Configuration: Check OpenSSL's configuration files for any settings that might restrict TLS versions or cipher suites.
Technical article

Documentation from Microsoft Learn explains that TLS handshake failures can occur due to certificate issues (expired, revoked, or untrusted), protocol mismatches (server and client not supporting a common protocol), cipher suite incompatibility, or network issues interrupting the handshake process. Ensure both the Postfix and Exchange server have valid certificates, support compatible TLS versions and cipher suites, and that no firewalls are blocking the necessary ports.

July 2021 - Microsoft Learn
Technical article

Documentation from Microsoft Learn discusses ensuring that Exchange Server is configured to support TLS 1.2 or higher. TLS 1.0 and 1.1 are deprecated and may cause handshake failures. Update Exchange server to use modern TLS protocols and cipher suites.

September 2022 - Microsoft Learn
Technical article

Documentation from Postfix.org details the various `smtp_tls_*` and `smtpd_tls_*` configuration parameters. Check settings like `smtp_tls_security_level`, `smtp_tls_mandatory_protocols`, `smtp_tls_mandatory_ciphers`, `smtpd_tls_cert_file`, and `smtpd_tls_key_file`. Ensure the certificate and key files are correctly configured and accessible, and that the TLS settings are compatible with the Exchange server's requirements.

April 2023 - Postfix.org
Technical article

Documentation from OpenSSL.org recommends checking the OpenSSL configuration files for any restrictions on TLS versions or cipher suites. Also check that the Exchange server's certificate is trusted.

January 2024 - OpenSSL.org