From 5b9ff2c334a3a85c25b11bc17009f211eec51575 Mon Sep 17 00:00:00 2001 From: Philip Wittamore Date: Tue, 3 Jun 2025 20:12:49 +0200 Subject: update --- pw-update-fingerprint | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 pw-update-fingerprint (limited to 'pw-update-fingerprint') diff --git a/pw-update-fingerprint b/pw-update-fingerprint new file mode 100755 index 0000000..e25a0b4 --- /dev/null +++ b/pw-update-fingerprint @@ -0,0 +1,16 @@ +#!/bin/bash + +# update tls_fingerprint entry in ~/.msmtprc + +MAILSERVER="mail.server.com" +PORT="587" + +cd $HOME + +# get the server fingerprint +KEY=$(msmtp --serverinfo --tls --tls-certcheck=off --host="$MAILSERVER" --port="$PORT" | grep -E -o "([0-9A-Za-z]{2}:){31}[0-9A-Za-z]{2}") + +# replace tls_fingerprint line in .msmtprc +sed -i "s/^tls_fingerprint.*/tls_fingerprint $KEY/g" .msmtprc + +echo ".msmtprc has been updated with the latest $MAILSERVER fingerprint." -- cgit v1.2.3