Is it possible with Postfix to add a warning to all emails received over a cleartext (non-TLS) connection?
For example modifying the subject and/or adding a custom header.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
The way to go here is to first tell Postfix to add the TLS connection status into the Received header. In
smtpd_tls_received_header = yes
This will add something like
(using TLSv1.2 with cipher … (256/256bits)) to the postfix generated received header.
This information can then be used to add a custom headers. E.g. one could add a
X-Transport-Layer-Security header and set its value depending on whether the above snippet is present in the Received header. Possible methods to do so include
I don't know of any ready-made solution to do this, but it shouldn't be much work either.