How to verify that email from own server to google relay SMTP service is using TLS
Solution 1:
You want to look at the Received:
header of your mail as it was received, the line where Google traces your message being transmitted from your Postfix server to the first Google server. That header should specify the protocol as ESMTPS - the (second) S signalling a secure channel.
There will be another Received:
header where your Postfix server notes the receipt of the message from django/python, but if that submission is guaranteed to never leave your machine (connection from ::1
to ::1
), it should be of little concern whether that connection employed any transport security.
It is customary to have such trace headers additionally contain information about specific protocol versions and ciphers used (Google appears to do that most of the time).
If you know your mail server is not supposed to send out mail unencrypted - because you exclusively send mail to modern providers, or you are relaying all your mail to Google - consider enforcing that via smtp_tls_security_level
in your postfix configuration. Looking at one message only tells you that in this particular instance, everything worked. You may not want it to silently fallback to unencrypted submission in the future.