1#!/bin/sh
2
3if [ -z "$1" ]; then
4echo "error: domain missing (sealight.xyz)"
5 exit 1
6fi
7
8domain="$1"
9errors=""
10
11dig +short MX "$domain" | grep -q 'smtp-in-1.nullhex.com' || errors="smtp-in-1.nullhex.com record not found"
12dig +short MX "$domain" | grep -q 'smtp-in-2.nullhex.com' || errors="$errors\nsmtp-in-2.nullhex.com record not found"
13dig +short TXT "$domain" | grep -q '^"v=spf1 a mx ~all"$' || errors="$errors\nspf record not found"
14dig +short CNAME "key1._domainkey.$domain" | grep -q 'key1.nullhex.com' || errors="$errors\nkey1._domainkey.$domain record not found"
15dig +short TXT "_dmarc.$domain" | grep -q '^"v=DMARC1; p=quarantine;"$' || errors="$errors\ndmarc TXT record is missing"
16dig +short SRV "_autodiscover._tcp.$domain" | grep -q '443 autodiscover.nullhex.com.' || errors="$errors\nautodiscover SRV record is missing"
17dig +short SRV "_imaps._tcp.$domain" | grep -q '993 imap.nullhex.com.' || errors="$errors\nimap SRV record is missing"
18dig +short SRV "_submissions._tcp.$domain" | grep -q '465 smtp.nullhex.com.' || errors="$errors\nsmtp SRV record is missing"
19dig +short CNAME "autoconfig.$domain" | grep -q 'autoconfig.nullhex.com.' || errors="$errors\nautoconfig CNAME record is missing"
20
21if [ ! -z "$errors" ]; then
22 echo "$errors"
23 exit 1
24else
25 echo "success! u are redy"
26fi