summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmailcert.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/mailcert.sh b/mailcert.sh
index d3301d5..7767be6 100755
--- a/mailcert.sh
+++ b/mailcert.sh
@@ -56,4 +56,18 @@ echo USEREMAIL is assumed to be: "$USEREMAIL"
echo Press Ctrl-C if any of this looks incorrect.
sleep 5
+[[ $(openssl x509 -in omgca/ca/omgca.crt -noout -subject) =~ .+CN=(.+) ]]
+CACN="${BASH_REMATCH[1]}"
+if [[ "$CACN" =~ (.+)/emailAddress.+ ]]; then
+ CACN=${BASH_REMATCH[1]}
+fi
+
# FIXME: implement /usr/lib/sendmail input, including attachment syntax
+# /usr/lib/sendmail -t << EOF
+cat << EOF
+To: "$USEREMAIL"
+From: "$E"
+Subject: Certificate from "$CACN"
+MIME-Version: 1.0
+Content-Type:
+