Bingpreview invalidates one time links in email

China☆狼群 提交于 2019-12-05 07:13:52

I did the same.

$user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
        // Deny access for the BingPreview bot, used by outlook.com on links in e-mails ad Slackbot
        if (strpos($user_agent, 'BingPreview') !== false || strpos($user_agent, 'Slackbot') !== false) {
            header('Status: 403 Forbiden', true, 403);
            exit(1);
        }

I've seen the same issue. The links in emails opened in outlook seem to be crawled immediately by the 'BingPreview' bot.

I've added a robots meta tag to the header in the HTML email.

I've also added a check for standard bot signatures appearing in the user-agent header in the link handling script. If it looks like a bot then I'm exiting and not invalidating the link.

Can't say for sure that this is working yet (only just made the changes).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!