如何阻止 e-mail 客户端自动访问 e-mail 中的链接?
How to stop e-mail clients from visiting links in e-mail automatically?
我有一个 PHP 发送 plain-text e-mails 的脚本,其中包含 link 某些操作,如确认和协议等
我注意到的是网页版的Outlook会自动检测link并在用户点击之前在后台访问link。我注意到了这一点,因为一旦我打开 e-mail,数据库中的内容就会发生变化。
同时检查 Apache 访问日志,我看到 BingPreview/1.0b 作为用户代理。
这非常糟糕,因为用户可能不想执行这些操作。
我可以发送 e-mail headers 来禁用此行为吗?建议?
正如我在评论中所写:
"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 也建议使用复选框。
在"Subscription"下:
"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:
这是关于 Google 和复选框的另一篇文章;即使它是 "spam-related",同样的逻辑也适用:
摘自那篇文章:
"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."
所有这些都设置在条件语句中,以检查是否单击了提交按钮并设置了复选框,每个都使用名称属性。
即:
<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?
在哪里建议了 honeypost 和其他一些建议。
以下是从您已删除的答案中提取的。
参考:
"您可以做的一件事是,设置您的 .htaccess 以阻止 BingPreview 用户代理访问您的注册和密码重置路径(您的路径可能与此示例不同)::
RewriteEngine On
RewriteCond %{REQUEST_URI} /signup/confirm/ [OR]
RewriteCond %{REQUEST_URI} /resetting/reset/
RewriteCond %{HTTP_USER_AGENT} BingPreview
RewriteRule . - [F,L]
"This will stop the BingPreview crawler, but I feel like it is an incomplete solution. You can block as many annoying user agents here as you want, but do you really want to spend all your time hunting down which email providers are providing similar link previews in their emails?"
我有一个 PHP 发送 plain-text e-mails 的脚本,其中包含 link 某些操作,如确认和协议等
我注意到的是网页版的Outlook会自动检测link并在用户点击之前在后台访问link。我注意到了这一点,因为一旦我打开 e-mail,数据库中的内容就会发生变化。 同时检查 Apache 访问日志,我看到 BingPreview/1.0b 作为用户代理。
这非常糟糕,因为用户可能不想执行这些操作。
我可以发送 e-mail headers 来禁用此行为吗?建议?
正如我在评论中所写:
"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 也建议使用复选框。
在"Subscription"下:
"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:
这是关于 Google 和复选框的另一篇文章;即使它是 "spam-related",同样的逻辑也适用:
摘自那篇文章:
"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."
所有这些都设置在条件语句中,以检查是否单击了提交按钮并设置了复选框,每个都使用名称属性。
即:
<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?
在哪里建议了 honeypost 和其他一些建议。
以下是从您已删除的答案中提取的。
参考:
"您可以做的一件事是,设置您的 .htaccess 以阻止 BingPreview 用户代理访问您的注册和密码重置路径(您的路径可能与此示例不同)::
RewriteEngine On
RewriteCond %{REQUEST_URI} /signup/confirm/ [OR]
RewriteCond %{REQUEST_URI} /resetting/reset/
RewriteCond %{HTTP_USER_AGENT} BingPreview
RewriteRule . - [F,L]
"This will stop the BingPreview crawler, but I feel like it is an incomplete solution. You can block as many annoying user agents here as you want, but do you really want to spend all your time hunting down which email providers are providing similar link previews in their emails?"