如何在出站电子邮件上显示广告?

发布于 2024-08-04 02:45:08 字数 685 浏览 10 评论 0原文

我需要能够根据收件人的人口统计信息在通过服务器(最好是后缀)转发的电子邮件上显示广告。基本上,[email protected] 的邮件将到达并转发至 [电子邮件受保护],底部有一个小广告。

我想使用 postfix,因为它似乎能够使用 mysql 数据来完成各种任务,这将是有益的,这样系统就可以由为数据库提供数据的 Web 应用程序进行控制。

由于定位渠道(用于根据人口统计信息选择广告)、执行文本广告和电子邮件区域的能力以及在本地运行的能力,我更愿意使用 OpenX 作为广告服务器。当然,更适合此问题的其他广告服务器也是可以接受的。

在我看来,问题的核心是能够在任何给定电子邮件的底部写一些东西。当然,html 消息使这变得更加棘手,但我会满足于拥有一个适用于纯文本并从那里开始工作的解决方案。

商业软件也是一个选择,但是几天的断断续续的搜索并没有找到任何结果。

I need to be able to display ads on email forwarded through a server (preferably postfix) based on the demographic information of the recipient. Basically a message will arrive for [email protected] and be forwarded to [email protected] with a small advertisement at the bottom.

I would like to use postfix because it appears to be able to use mysql data for various tasks, which would be beneficial so that the system could be controlled by a web app that feeds the database.

I'd prefer to use OpenX for the ad server due to targetting channels (used to select ads based on demographic information), the ability to do text ads as well as email zones, and the ability to run it locally. Other ad servers that are better suited to this problem are acceptable, of course.

The core of the problem, as I see it, is being able to write something at the bottom of any given email message. Of course html messages make this even trickier, but I'd settle for having a solution that works for plain text and work up from there.

Commercial software is an option as well, but a few days of intermittent searching hasn't turned anything up.

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

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

发布评论

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

评论(2

一身软味 2024-08-11 02:45:08

在很多情况下,简单地在电子邮件底部写入一些内容会严重失败,特别是对于封装在 MIME 多部分消息(或 MIME 多部分消息中的其他任何内容)中的 HTML 电子邮件,因为最后一个 MIME 部分标记之后的任何内容都是明确假定的被任何 MIME 解析器忽略。如果您希望应用程序正常工作,则需要

  • 确定目标消息是否是除 TEXT/PLAIN 之外的 MIME 消息
    • 如果不是,请在末尾附加纯文字广告,然后就完成了
  • 如果是,则完成,确定其是否是多部分的
    • 如果不是,那么您需要确定整个消息的内容类型
      • 如果内容类型是 HTML,那么您可以尝试在适当的位置插入广告 HTML。这将是非常偶然的,因为你不知道 HTML 布局会是什么样子。
      • 如果内容类型不是 HTML(或者可能是 RTF),您最好不要碰该消息。
  • 如果消息是多部分的,请确定子类型
    • 如果是“混合”,那么您需要确定哪一部分(如果有)是主要可读内容,然后根据上述规则修改该部分,就好像它是整个消息一样
    • 如果是“替代”,那么您需要找到所有可读部分,并根据上述规则依次修改每个部分

最后,也是最重要的是,

  • 请做好准备,迎接来自每个通过您的服务器路由邮件的人的巨大恶意。

Simply writing something to the bottom of the email message will fail miserably in a LOT of cases, particularly with HTML email encapsulated in a MIME multipart message (or anything else in a MIME multipart message) because anything after the last MIME section marker is explicitly supposed to be ignored by any MIME parser. If you want your app to work it needs to

  • determine if the target message is a MIME message other than TEXT/PLAIN
    • If it is not, append your text only ad at the end and you're done
  • if it is, determine if its multipart
    • if not, then you need to determine the content type of the whole message
      • If the content type is HTML then you can attempt to insert your ad HTML somewhere appropriate. This will be very hit or miss since you have no idea what the HTML layout will be like.
      • if the content type is anything OTHER than HTML (or maybe RTF), you're best off not touching the message.
  • If the message is multipart, determine the subtype
    • if its 'mixed', then you need to determine which part if any is the primary readable content, and then modify that portion as if it were the whole message based on the above rules
    • If its 'alternative' then you need to find ALL the readable portions and modify each of them in turn according to the above rules

Finally, and most importantly

  • Be prepared for the massive ill will you will receive from everyone who gets mail routed through your server.
何处潇湘 2024-08-11 02:45:08

让我想想...人们注册了您的服务,我认为这是免费的。他们向您提供他们的真实电子邮件地址,作为回报,您向他们提供一个不同的电子邮件地址,他们可以使用该地址订阅邮件列表和其他服务。也许还有一些垃圾邮件过滤功能?对我来说,这听起来像是一项合法服务,特别是如果您只向订阅者提供广告。不过,我确实想知道您是否会获得很多订阅,因为许多人可以轻松使用 Google、Yahoo 或 Hotmail 帐户来实现这些目的。那么,这些订阅者将获得什么附加值呢?

不管怎样,您需要修改现有的电子邮件,当它们是 HTML 邮件或经过数字签名时,这有点复杂。 (特别是在后一种情况下,您实际上会阻止收件人接收这些电子邮件,因为他们的电子邮件系统会检测到电子邮件已被篡改。您也可能面临可能的法律问题的风险,尽管我认为没有只要接收者同意您的服务条款,就不会发生任何非法行为。

Let me see... People sign up for your service, which I assume is free. They provide you their real email address and in return you provide them a different email address which they can use to e.g. subscribe to mailinglists and for other services. And maybe some spamfilter functionality? That sounds like a legit service to me, especially if you only provide the ads to the person who subscribed. I do wonder if you'd get many subscriptions, though, since many people can just as easy use a Google, Yahoo or Hotmail account for these purposes. So, what is the added value those subscribers will get?

Anyway, you would need to modify existing emails, which is a bit complex when they are HTML mails or if they're digitally signed. (Especially in the latter case, you would actually block the recipient from receiving those emails, since their email system would detect that the email has been tampered with. You might also be at risk of possible legal problems, although I don't think there's anything illegal as long as the recipient agrees with the terms of your service.

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