2022
我们一起努力

检查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"$from=”xxx@contoso.com”
br/>$from=”xxx@contoso.com”<br/$to="xxx@contoso.com"$cc="xxx@contoso.com"
br/>$cc=”xxx@contoso.com”<br/$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
}

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

else
{ Send-MailMessage -Subject $msg2 -SmtpServer $smtp -From $from -to $to -cc $cc -Body "$body1"
}

赞(0)
文章名称:《检查SMTP地址是否被检测网站列入黑名单》
文章链接:https://www.fzvps.com/114941.html
本站文章来源于互联网,如有侵权,请联系管理删除,本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。
图片版权归属各自创作者所有,图片水印出于防止被无耻之徒盗取劳动成果的目的。

评论 抢沙发

评论前必须登录!