Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bingpreview invalidates one time links in email

It seems that Outlook.com uses the BingPreview crawler to crawl links in emails.

But the one-time links are marked as used/expired after opening the email and before the user gets the chance to use them.

I try to add a rel="nofollow" in the <a> but without success.

How can I block the crawler for each links in email ?

Thanks

like image 248
colas Avatar asked Jan 17 '17 13:01

colas


4 Answers

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);
        }
like image 130
colas Avatar answered Nov 20 '22 20:11

colas


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).

like image 36
ColinK Avatar answered Nov 20 '22 20:11

ColinK


I've just experienced the same issue with confirmation links being executed in a sent email before the user has received them and invalidating the link. I got around the issue by modifying the page the URL links to. I've added a Confirm button on the page which the user has to click to confirm their email and this works nicely.

like image 1
Shawn White Avatar answered Nov 20 '22 18:11

Shawn White


same here. we used a program block to disallow BingPreview and Slackbot and some more to access the links by using server script language (lucee/coldfusion and application.cfc)

like image 1
Raffael Meier Avatar answered Nov 20 '22 19:11

Raffael Meier