php - 如何阻止电子邮件客户端自动访问电子邮件中的链接?

标签 php email bing

我有一个 PHP 脚本,它发送纯文本电子邮件,其中包含指向某些操作(如确认和协议(protocol)等)的链接。

我注意到的是,Web 版本的 Outlook 会在用户点击链接之前自动检测该链接并在后台访问该链接。我注意到了这一点,因为一旦我打开电子邮件,数据库中的内容就会发生变化。
同时检查Apache访问日志,我看到 BingPreview/1.0b 作为用户代理。

这是非常糟糕的,因为用户可能不想执行这些操作。

是否可以发送电子邮件标题来禁用此行为?建议?

最佳答案

正如我在评论中所写:

"You could use some form of input button and a checkbox all set in conditional statements. Those can't physically be clicked/checked."



旁注更正:我犯了一个轻微的语法错误。那应该读作:

"You could use some form of input button and a checkbox all set in conditional statements. Those can't virtually be clicked/checked, and must be physically done by a real person."



甚至 Google 也建议使用复选框。
  • https://support.google.com/mail/answer/81126?hl=en

  • 在“订阅”下:

    "By manually checking a box on a web form, or within a piece of software."





    "Setting a checkbox on a web form or within a piece of software to subscribe all users by default (requiring users to explicitly opt-out of mailings)."



    此外,您可以使用 reCAPTCHA:
  • https://www.google.com/recaptcha/intro/

  • 这是关于 Google 和复选框的另一篇文章;即使它是“垃圾邮件相关的”,同样的逻辑也适用:
  • http://blogs.findlaw.com/technologist/2014/12/google-replaces-annoying-anti-spam-captcha-with-checkbox-kittens.html

  • 摘自那篇文章:

    "Google introduced a better solution this week: the "No CAPTCHA reCAPTCHA," which we'll refer to as "checkboxes and kittens."





    "That's it. A checkbox. "I'm not a robot." Though Google doesn't go into detail on the magic behind the box, the blog post announcing the change said that a "risk analysis engine" measures how a user interacts with a page, and with the CAPTCHA, to tell if anything more than a simple checkbox is necessary. If you're detected as a human, you check a box and hit submit."



    所有这些都在条件语句中设置,以检查是否单击了提交按钮并设置了复选框,使用每个的名称属性。

    IE。:
    <form action="handler.php" method="post">
    
        <input type="checkbox" value="XX" name="checkbox_x">
        <input type="submit" name="submit_button">
    
    </form>
    
    <?php 
        if(isset($_POST['submit_button'])){
    
            if(isset($_POST['checkbox_x'])){
    
            // Do your thing
            // Additionally, you could place GET array(s) if they're being used
            // and also check to see if any are set and not empty.
    
            }
    
    
        }
    ?>
    

    旁注:您还可以使用 && (AND) logical operator 检查复选框是否与上述内容相同。 .

    示例:&& $_POST['checkbox_x'] == 'XX' .

    您还可以查看 Stack 上的这个问答:
  • Checkbox as alternative to captcha?

  • 建议使用蜜站和其他一些建议。

    以下内容摘自您已删除的答案。

    引用:
  • http://south634.com/is-hotmail-clicking-your-account-confirmation-links/

  • “您可以做的一件事是,设置 .htaccess 以阻止 BingPreview 用户代理访问您的注册和密码重置路径(您的路径可能与此示例不同)::
    RewriteEngine On
    RewriteCond %{REQUEST_URI} /signup/confirm/ [OR]
    RewriteCond %{REQUEST_URI} /resetting/reset/ 
    RewriteCond %{HTTP_USER_AGENT} BingPreview
    RewriteRule . - [F,L]
    

    “这会阻止 BingPreview 爬虫,但我觉得这是一个不完整的解决方案。你可以在这里屏蔽尽可能多的烦人的用户代理,但你真的想花所有的时间来寻找哪些电子邮件提供商提供了类似的链接吗?在他们的电子邮件中预览?”

    关于php - 如何阻止电子邮件客户端自动访问电子邮件中的链接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43443947/

    相关文章:

    php - 为图像添加动态帧

    php - 如何获取链接您的图像的网站的 URL?

    php - Gmail删除链接标签,如何避免这种情况

    Powershell 验证电子邮件地址

    ruby-on-rails - Bing 搜索 API 结果随着 web.offset(skip) 值的增加而减少

    php - 查询按 "date"字段排序的两张表

    php - mysqli php 选择最近的条目 asc

    javascript - Meteor 查找所有用户电子邮件

    Azure Bing Web 搜索因查询搜索而失败

    css - Bing 等搜索框内的搜索按钮