构建通过 pop3 拉取 emai 的 Web 邮件客户端时存在哪些类型的编码/图像/格式问题

发布于 2024-09-17 06:49:57 字数 166 浏览 14 评论 0原文

在构建通过 pop3 提取 emai 的 Web 邮件客户端时,存在哪些类型的编码/图像/格式问题?

我能想到的一些事情我知道我必须处理:

  1. 附件
  2. 内嵌图像
  3. html 电子邮件

还有哪些其他可能令人头痛的问题?

What sort of encoding/image/formatting issues are there when building a web mail client that pulls emai via pop3?

Some things i can think of that I know I will have to handle:

  1. attachments
  2. inline images
  3. html emails

What other possible headaches are there?

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

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

发布评论

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

评论(3

哭了丶谁疼 2024-09-24 06:49:57

这是一项相当大量的工作,并且已经有很多解决方案 - 但这不应该阻止您!您的三点几乎涵盖了一般情况下的所有内容...事实是通过 POP3 传递的事实并不那么相关,IMAP,甚至 OWS(Outlook Web Services for Exchange)都需要注意以下几点:

  • 附件可以参考内联在电子邮件中(1、2、3 的组合)- 因为在电子邮件中可以包含图像,图像本身就是附件。
  • 您必须支持多种 MIME 类型。
  • 电子邮件可以是单部分、多部分不同、多部分替代及其组合。一份好的时事通讯会向您发送一条短信和信息。相同数据的 HTML 版本让客户端可以选择使用数据的方式。该电子邮件可能包含一个或多个附件...并且该附件可以是另一封带有另一个附件的文本/html 电子邮件...这会令人厌烦。
  • HTML 正如您已经指出的,在页面内渲染电子邮件 HTML 而不在样式等方面相交是很棘手的,而且您还需要过滤不良内容 - JavaScript 可能包含可能会影响隐私的嵌入图像。
  • 有几种可以使用的字符编码 - 这与 MIME 类型相关,但值得单独注意(仅是为了令人头疼)。

基本上,您必须精通多种交易才能生成和解码电子邮件。

It's quite a lot of work, and there are already a lot of solutions out there - but that shouldn't deter you! Your three points cover almost everything in general terms... the fact it's coming through POP3 isn't all that relevant, IMAP, or even OWS (Outlook Web Services for Exchange) all require attention to the following points:

  • Attachments can be referred to inline in an email (combo of your 1,2,3) - as in an email can include an IMAGE which is itself an attachment.
  • There are many MIME types you have to support.
  • Emails can be a single part, multi-part different, multi-part alternative, and combinations thereof. A good newsletter will send you a text & HTML version of the same data leaving the client the choice to choose which way to consume the data. That email could have one or more attachments... and that attachment can be another text/html email with another attachment... and this goes on ad nauseam.
  • HTML As you've already pointed out, rendering email HTML inside your page without intersects in style etc is tricky, plus you'll want to filter for bad content - JavaScript includes potentially, embedded images which might have privacy implications.
  • There are several character encodings that can be used - this ties into MIME types, but is worth independently noting (for headache-worthiness alone).

Basically you have to be jack of a number of trades to generate and decode emails.

懷念過去 2024-09-24 06:49:57

许多 !

我强烈建议您阅读 pop3 rfc 作为入门。

http://www.faqs.org/rfcs/rfc1939.html

您可以下载很少有开源项目可以看看他们是如何实现 rfc 的。

Many !

I highly suggest you to read the pop3 rfc as a starter.

http://www.faqs.org/rfcs/rfc1939.html

You can download few open source projects to see how they implemented the rfc's.

风追烟花雨 2024-09-24 06:49:57

我同意皮埃尔的观点,您应该阅读规范以充分了解幕后发生的事情。

我要补充的一件事是,我担心的关键事情是您正在阅读的邮箱和垃圾邮件的安全性。电子邮件通常包含对 javascript/图像的调用,可用于跟踪邮件是否已被打开。这是许多邮件客户端不显示图像的关键原因,除非您打开它们。

除了您使用的其他方法之外,您可能还必须确保解析消息并删除任何可能导致隐私问题的调用,除非发件人是可信的。

I agree with Pierre that you should read the specs to fully understand what's going on behind the scenes.

One thing I would add though is that the key thing I would be worried about is the security of the mailboxes you are reading and SPAM. Emails often contain calls to javascript/images that can be used to track whether the message has been opened. This is the key reason many mail client don't show images unless you turn them on.

Along with the other methods you are using you will probably have to make sure you parse the message and take out any calls that could potentially cause privacy issues unless the senders are trusted.

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