vmail-stack/bin/vmail-dkim-del.sh
Matthew Saunders Brown 4bf85f8839 reworked getopts
2021-10-15 15:17:29 -07:00

49 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
#
# vmail-stack
# https://git.stack-source.com/msb/vmail-stack
# MIT License Copyright (c) 2021 Matthew Saunders Brown
# load include file
source $(dirname $0)/vmail.sh
help()
{
thisfilename=$(basename -- "$0")
echo "$thisfilename"
echo "Get email alias data from vmail database."
echo ""
echo "usage: $thisfilename -d <domain> [-h]"
echo ""
echo " -h Print this help."
echo " -d Domain name to remove DKIM key from."
echo ""
echo " DKIM key for the specified domain is removed from the server and"
echo " outgoing emails will no longer be signed with DKIM. You should also"
echo " remove the associated DNS entry, however leaving the DNS entry in"
echo " place should not cause any immediate problems."
exit
}
vmail:getoptions "$@"
# check for domain
if [[ -z $domain ]]; then
echo "domain name is required"
exit
fi
# check for existing dkim
if [ ! -f /etc/ssl/dkim/$domain.dkim ]; then
echo "dkim for $domain does not exist"
exit 1
fi
echo delete this dkim dns record
echo
cat /etc/ssl/dkim/$domain.dns
echo
rm /etc/ssl/dkim/$domain.*