forked from fmarier/user-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mail_fingerprints
executable file
·38 lines (30 loc) · 1.37 KB
/
mail_fingerprints
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
POP_FILE="$(mktemp)"
IMAP1_FILE="$(mktemp)"
IMAP2_FILE="$(mktemp)"
SMTP1_FILE="$(mktemp)"
SMTP2_FILE="$(mktemp)"
SMTP3_FILE="$(mktemp)"
echo "" | openssl s_client -connect pop.gmail.com:995 -showcerts > "$POP_FILE" 2> /dev/null
echo "" | openssl s_client -connect imap.gmail.com:993 -showcerts > "$IMAP1_FILE" 2> /dev/null
echo "" | openssl s_client -connect imap.kolabnow.com:993 -showcerts > "$IMAP2_FILE" 2> /dev/null
echo "" | openssl s_client -connect smtp.gmail.com:587 -starttls smtp -showcerts > "$SMTP1_FILE" 2> /dev/null
echo "" | openssl s_client -connect smtp.kolabnow.com:587 -starttls smtp -showcerts > "$SMTP2_FILE" 2> /dev/null
echo "" | openssl s_client -connect smtp.novuscom.net:587 -starttls smtp -showcerts > "$SMTP3_FILE" 2> /dev/null
echo "pop.gmail.com:"
openssl x509 -fingerprint -md5 -noout -in "$POP_FILE" && rm "$POP_FILE"
echo
echo "imap.gmail.com:"
openssl x509 -fingerprint -md5 -noout -in "$IMAP1_FILE" && rm "$IMAP1_FILE"
echo
echo "imap.kolabnow.com:"
openssl x509 -fingerprint -md5 -noout -in "$IMAP2_FILE" && rm "$IMAP2_FILE"
echo
echo "smtp.gmail.com:"
openssl x509 -fingerprint -sha256 -noout -in "$SMTP1_FILE" && rm "$SMTP1_FILE"
echo
echo "smtp.kolabnow.com:"
openssl x509 -fingerprint -sha256 -noout -in "$SMTP2_FILE" && rm "$SMTP2_FILE"
echo
echo "smtp.novuscom.net:"
openssl x509 -fingerprint -sha256 -noout -in "$SMTP3_FILE" && rm "$SMTP3_FILE"