检查SMTP地址是否被检测网站列入黑名单

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了检查SMTP地址是否被检测网站列入黑名单相关的知识,希望对你有一定的参考价值。

            通常,我们可能因为某些用户发送了一些非常规邮件,邮件出口地址被一些权威网站列入黑名单,导致大量业务邮件无法正常发送。

            这时候,我们可以通过powershell写一些关于IP地址检测的脚本,并列入计划任务,最大程度上降低邮件出口地址被列入黑名单产生的业务影响,脚本内容如下:

#获取页面信息
$web=(Invoke-WebRequest "https://www.talosintelligence.com/reputation_center/lookup?search=xxx.xxx.xxx.xxx").content

#自定义邮件属性&内容
$msg1="xxx.xxx.xxx.xxx blacklist, Please check!"
$msg2="Mailaddress is not included in the blacklist!"
$smtp="smtp server"br/>$from="[email protected]"
$to="[email protected]"
br/>$cc="[email protected]"
$body="Smtp address in the blacklist,Please access
http://www.spamhaus.org Remove!"
$body1="Smtp address is OK!"

#判断IP地址是否被Black
if ($web -match ‘<span class="blacklisted">Listed</span>‘ )
{ 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"
}



以上是关于检查SMTP地址是否被检测网站列入黑名单的主要内容,如果未能解决你的问题,请参考以下文章

Powershell检测邮箱IP/出口IP是否被列入spamhaus等黑名单

国内和国际反垃圾邮件组织

虚拟主机网站安全迁移技巧

在express,node.js中使用req.ip将IP地址列入白名单是不是安全?

将网站电子邮件列入白名单,使其不会作为垃圾邮件被拒绝

如何将应用程序 / exe 列入白名单