将电子邮件传送到程序&防止垃圾邮件快速提交

发布于 2024-11-28 05:50:44 字数 223 浏览 2 评论 0原文

我正在开发一个网站,理想情况下,任何人都可以向指定地址发送电子邮件并将照片附加到他们的消息中(例如,通过 iPhone)。该地址将被设置为将电子邮件通过管道传输到 PHP 脚本,然后该脚本将处理该照片并将其存储在我们的服务器上。

我发现这个系统很容易被滥用:有人在自己的服务器上设置一个页面,反复向该地址发送垃圾邮件照片,从而堵塞我们的存储空间和服务器资源。有人对如何最小化这种风险有建议吗?

谢谢!

I'm working on a site where, ideally, anyone will be able to email a specified address and attach a photo to their message (e.g. from an iPhone). This address will be set to pipe the email to a PHP script, which will then process this photo store it on our server.

I can see this system being pretty easy to abuse: someone sets up a page on their own server to repeatedly spam the address with photos, clogging up our storage space and server resources. Anyone have a suggestion on how to minimize this risk?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

淡看悲欢离合 2024-12-05 05:50:44

几个选择,从我的脑海中浮现出来。不过,我会使用组合:

  1. 使用注册系统(用验证码保护),以便只有注册用户才能使用该服务;为每个用户提供自己的秘密电子邮件地址,并且仅接受来自其注册地址的电子邮件。 (是的,他们的地址可以被欺骗,但这至少可以防止偶然的滥用者)
  2. 要求用户在主题行中输入密码,这样即使他们的from地址被攻击者欺骗,他们还需要知道代码,否则邮件会被拒绝
  3. 设置每个帐户的限制
  4. 限制照片大小,这样就不会有人尝试重复上传 100 MB 的照片

A few options, off of the top of my head. I'd use a combination, though:

  1. Use a registration system (guarded with a CAPTCHA) so that only registered users can use the service; give each user their own secret email address, and only accept emails from their registered address. (Yes, their address can be spoofed, but it's at least some protection against casual abusers)
  2. Require the user put a secret code in the subject line so that even if their from address is spoofed by an attacker, they'd also need to know the code or else the message is rejected
  3. Set up per-account limiting
  4. Limit the photo size so someone doesn't try to upload a 100 MB photo repeatedly
绾颜 2024-12-05 05:50:44

我在这里没有看到万无一失的方法。但是,您可以将此过程视为用户注册过程。一旦有人向您发送电子邮件,您会将电子邮件存储在临时存储中,将自动生成的消息发送回原始电子邮件地址,要求他们单击唯一的链接来确认或使用一些特殊文本回复该电子邮件。

I don't see a fool proof method here. However you can treat this process like a user registration process. Once someone sends an email to you, you store the email in a temp storage, send an auto generated message back to the originating email address, asking them to click on a unique link to confirm or replying to that email with some special text.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文