30 lines
543 B
Bash
30 lines
543 B
Bash
|
#!/bin/bash
|
||
|
#
|
||
|
# vmail-stack
|
||
|
# https://git.stack-source.com/msb/vmail-stack
|
||
|
# MIT License Copyright (c) 2021 Matthew Saunders Brown
|
||
|
|
||
|
# load config
|
||
|
source /usr/local/etc/vmail.conf
|
||
|
|
||
|
# check for and set virtualhost
|
||
|
if [ -n "$1" ]; then
|
||
|
virtualhost=$1
|
||
|
else
|
||
|
echo "virtualhost not set"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
# check for existing dkim
|
||
|
if [ ! -f /etc/ssl/dkim/$virtualhost.dkim ]; then
|
||
|
echo "dkim for $virtualhost does not exist"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
echo delete this dkim dns record
|
||
|
echo
|
||
|
cat /etc/ssl/dkim/$virtualhost.dns
|
||
|
echo
|
||
|
|
||
|
rm /etc/ssl/dkim/$virtualhost.*
|