Check whether the SMTP address is blacklisted by the detected website.
Usually, we may send a large number of business emails because some users have sent some unconventional emails, and the email exit address has been blacklisted by some authoritative websites. At this time, we can write some scripts about IP address detection through powershell and include them in planned tasks to minimize the business impact caused by the blacklist of email exit addresses. The script content is as follows:
# get page information
$web= (Invoke-WebRequest "https://www.talosintelligence.com/reputation_center/lookup?search=xxx.xxx.xxx.xxx").content
# Custom message attributes & content
$msg1= "xxx.xxx.xxx.xxx blacklist, Please check!"
$msg2= "Mailaddress is not included in the blacklist!"
$smtp= "smtp server" $from= "xxx@contoso.com" br/ > $from= "xxx@contoso.com"
Br/ > $cc= "xxx@contoso.com"
$body1= "Smtp address is OK!"
# determine whether the IP address is Black
If ($web-match 'Listed')
{Send-MailMessage-Subject $msg1-SmtpServer $smtp-From $from-to $to-cc $cc-Body $body
}
Else
{Send-MailMessage-Subject $msg2-SmtpServer $smtp-From $from-to $to-cc $cc-Body "$body1"
}