我们可能因为某些用户账号被破解弱密码利用发送了一些非常规垃圾邮件,邮件出口公网IP地址被一些权威网站列入黑名单,导致大量业务邮件无法正常发送。
当然也有可能是员工自己发送的营销群发邮件,这时候,我们可以通过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 -mat