Get the App
SLTechnology News&Howtos  ›  Servers  › 

Check whether the SMTP address is blacklisted by the detected website.

Shulou Source: shulou.com Published: 2022-06-02 09:55:56 11月11日 Update

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"

}

Tags: Email address blacklist blackname business content script exit website detection maximum task information can pass attribute authority user degree page influence Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Shulou Tech Info macOS MariaDB Docker