So, I have setup an smtp server using smtp in a Debian 11 machine. It works perfect when sending emails from my phone and my computer, but it does not work when trying to send emails from the same host machine. The error I get when tailing /var/log/mail.log is
Aug 11 13:15:45 mail postfix/smtps/smtpd[2740]: SSL_accept error from mail.example.net[2a02:c207:2041:2547::1]: -1
Aug 11 13:15:45 mail postfix/smtps/smtpd[2740]: warning: TLS library problem: error:14094415:SSL routines:ssl3_read_bytes:sslv3 alert certificate expired:../ssl/record/rec_layer_s3.c:1543:SSL alert number 45:
Aug 11 13:15:45 mail postfix/smtps/smtpd[2740]: lost connection after CONNECT from mail.example.net[2a02:c207:2041:2547::1]
Aug 11 13:15:45 mail postfix/smtps/smtpd[2740]: disconnect from mail.example.net[2a02:c207:2041:2547::1] commands=0/0
This is the part of main.cf that relates to ssl configuration.
# TLS parameters
smtpd_tls_cert_file=/etc/letsencrypt/live/mail.example.com/fullchain.pem
smtpd_tls_key_file=/etc/letsencrypt/live/mail.example.com/privkey.pem
smtpd_tls_security_level=may
smtpd_tls_loglevel = 1
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_security_level=may
smtp_tls_loglevel = 1
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtpd_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtp_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtp_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
I tried using Thunderbird to send the message from another device and it did work. This rules out the possibility of the certificate being expired as the error message suggests. Any help would be appreciated.