From 94486adcec799489c9d4118ea36152327e975584 Mon Sep 17 00:00:00 2001 From: Joe Rayhawk Date: Mon, 28 Mar 2011 18:45:20 -0700 Subject: Slight progress on mailcert.sh --- mailcert.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'mailcert.sh') diff --git a/mailcert.sh b/mailcert.sh index 6002a1e..33a8467 100755 --- a/mailcert.sh +++ b/mailcert.sh @@ -54,4 +54,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: + -- cgit v1.2.3