check for common mail subdomains
This commit is contained in:
parent
322bf2a82d
commit
19fc7e41df
|
@ -99,6 +99,28 @@ fi
|
|||
# copy above www subdomain section and modify as desired to
|
||||
# automatically check for and add additional subdomains to cert
|
||||
|
||||
# check common additional mail subdomains
|
||||
if [[ $domain = mail.* ]]; then
|
||||
# check for imap subdomain
|
||||
dns=`host -t A ${domain/mail./imap.}|grep 'has address'|awk '{ print $4 }'`
|
||||
if [[ " ${ips[@]} " =~ " ${dns} " ]]; then
|
||||
command="$command -d ${domain/mail./imap.}"
|
||||
dnscheck=true
|
||||
fi
|
||||
# check for smtp subdomain
|
||||
dns=`host -t A ${domain/mail./smtp.}|grep 'has address'|awk '{ print $4 }'`
|
||||
if [[ " ${ips[@]} " =~ " ${dns} " ]]; then
|
||||
command="$command -d ${domain/mail./smtp.}"
|
||||
dnscheck=true
|
||||
fi
|
||||
# check for pop subdomain
|
||||
dns=`host -t A ${domain/mail./pop.}|grep 'has address'|awk '{ print $4 }'`
|
||||
if [[ " ${ips[@]} " =~ " ${dns} " ]]; then
|
||||
command="$command -d ${domain/mail./pop.}"
|
||||
dnscheck=true
|
||||
fi
|
||||
fi
|
||||
|
||||
# check if any of the dns lookups passed
|
||||
if [[ "$dnscheck" = "false" ]]; then
|
||||
echo "All dns checks failed, can't create cert."
|
||||
|
|
Loading…
Reference in New Issue
Block a user